deal with empty directories for upload