moxiecode / plupload

Plupload is JavaScript API for building file uploaders. It supports multiple file selection, file filtering, chunked upload, client side image downsizing and when necessary can fallback to alternative runtimes, like Flash and Silverlight.
http://www.plupload.com
GNU Affero General Public License v3.0
5.63k stars 1.42k forks source link

Selecting empty/zero bytes size files are not added to the queue, unable to alert users #1172

Open ixigen opened 9 years ago

ixigen commented 9 years ago

Hello, we're trying to implement the plupload uploader in a project and we found it confusing for the users that if we select empty files these are not added to the upload queue. Let's say this would not be a problem in most projects, less on collaborative designs where an user could upload an empty file then another user would add content to it.

We think that it should have been best to be able to configure if we allow or not empty files to be uploaded or at least to be able to catch an event when an empty file was not added to the queue and display an alert that the filex filey filez were not added to the queue because they are empty.

Is there a way to alert the users when they try to add empty files? the FileFiltered event is not triggered for empty files.

Thank you

jnfsmile commented 9 years ago

Did you solve this?

akhanPLH commented 7 years ago

Is there any plan to allow empty files to be uploaded? This is currently affecting our functionality as the original poster stated above.

jayarjo commented 7 years ago

@akhanPLH, how exactly is it affecting your functionality?

We decided to filter it out because IE used to hang on empty files (not sure if the Edge has the same issue). It didn't seem a problem at the time. Why would you want to upload empty files?

akhanPLH commented 7 years ago

We have multiple users that upload files into very large hierarchical folder structures. In some instances these directories may have files in them, while in other instances files may not exist yet. The users' expectation is that a folder should exist even if it is empty, because of the expectation that different users will fill these directories eventually. Having to go and traverse through multiple folders after an initial upload to mitigate the problem of missing directories is wieldy and complicates the move onto our system.

Additionally, and Im not sure if this is an identified issue, is that we found that a folder that consists of a single .txt file only uploads the folder, and not the txt file itself. This gets corrected if there is another file, such as a pdf, within the same folder. Only then does the txt file get uploaded. This is very dangerous as this can result in data loss for our users.

akhanPLH commented 7 years ago

I provided more feedback but haven't heard back anything still.

jayarjo commented 7 years ago

I'm going to add a custom option to allow empty files in the next minor release.

jayarjo commented 7 years ago

@akhanPLH are your users dropping folders onto uploader? or how?

Additionally, and Im not sure if this is an identified issue, is that we found that a folder that consists of a single .txt file only uploads the folder, and not the txt file itself. This gets corrected if there is another file, such as a pdf, within the same folder. Only then does the txt file get uploaded. This is very dangerous as this can result in data loss for our users.

I cannot reproduce it. Try this fiddle: http://play.plupload.com/t__J_/4. Are txt files allowed in your config?

rwesolowski721 commented 6 years ago

I'm observing similar issue trying to add an empty file to the queue. The plupload.FILE_SIZE_ERROR is returned and I can't see any option to allow users to upload such files. @jayarjo your fiddle work on version 2.3.1, the problem appear on the next version (in my case 2.3.3)

Edit: after digging into the plupload code I found workaround - inside the Init event we can remove this filter (or set it to false):

Init: function(uploader) {
  delete uploader.settings.filters.prevent_empty;
}