Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If file upload fails, upload button does not work again #1045

Closed
oromanos opened this issue Aug 16, 2017 · 9 comments
Closed

If file upload fails, upload button does not work again #1045

oromanos opened this issue Aug 16, 2017 · 9 comments

Comments

@oromanos
Copy link

I tried to upload a file and it had some error. The error message showed up fine. But for some reason if I click on the upload button again, the upload does not get fired. I checked and the button was enabled so I do not see why it would not upload again.

@kartik-v
Copy link
Owner

kartik-v commented Aug 18, 2017

Unless you use single file upload... all files selected on client are reset & cleared after server processing (either success or failure)... refer #985. You therefore either need to use single file upload OR for multiple file upload need to handle these error files via your server code ... or code your app to communicate to user to retry file selection.

@oromanos
Copy link
Author

I am uploading a single file. But it still beats the purpose of showing the upload button when you have already decided not to let the users re upload the file.

Moreover, when I select multiple files and try and upload a single file, all file upload buttons start showing the error that upload failed even though it failed for a single file. The same should happen in this case too although usability is lost.

@kartik-v
Copy link
Owner

kartik-v commented Aug 18, 2017

As mentioned earlier - please read it correct... for a single file upload mode you should be able to re-upload the file only if your server upload code returns an error (assuming you have the right updated codebase from this repo).

For multiple file batch upload - there is no consistent way of handling server errors on the client code. You need to program your app use case based on the type of server validation error you have programmed on your server (for example rejecting files based on count, total size, type, virus scan etc.). Based on the same you need to use fileinput events to trap these server errors and control your front end UI.

For multiple upload, if you use the upload icon within each single thumbnail to trigger upload and receive a server upload error - only the thumbnail that faces the error will be marked as error and not others. Only when you trigger the batch upload via the common upload button - you will need to handle the code accordingly on your server.

For example - try using a HTML native file input for multiple file upload and submitting the files via form - do you get errors specific to each file uploaded and can you control specific files uploaded?

Go through the discussion in #985 as well ... and feel free to put in your suggestions..

@oromanos
Copy link
Author

When you write single upload, I assume you mean the individual upload button on each of the selected file. In my use case, I do send back json data with error property. The error gets displayed fine. But again the upload button is still available/visible. Clicking on it does nothing.

I am not doing a batch upload.
I reallcannot fathom why you would not allow someone to try uploading a file again. What if the file upload fails due to lost internet connectivity?

@kartik-v
Copy link
Owner

kartik-v commented Aug 18, 2017

  • By Single File Upload I mean multiple property of file input is NOT SET... which means you can SELECT ONLY ONE file and thus UPLOAD ONLY ONE file. Have you tried using it?

If you use the individual upload icon on each thumbnail - it should allow you to retry the upload even in MULTIPLE upload mode. Confirm if you are not seeing this and you ARE using the latest plugin code from the repository?

As I mentioned, I am open to suggestions - but there is no concrete way to validate server batches uploaded in bulk together.

You need to consider all use cases rather than ONE off.. before mentioning a solution. Have you tried using a HTML native normal file input and selecting say 20 files together and submitting the form to server. Let us say internet connectivity is lost in between... is there a way you can code your client user interface to understand and retry? What if you as developer need to genuinely reject say 5 files on server and return an error and user still keeps on retrying the same... how will the client code understand what the server code meant to reject the file as? There are many such needs which are best handled from your server code... but will try to see if I can include feedback from others.

@oromanos
Copy link
Author

oromanos commented Aug 18, 2017 via email

@kartik-v
Copy link
Owner

Upload button for each errored thumbnail should be DISABLED as part of the process once file upload for the specific thumbnail errors out indicating that the upload action cannot be done.

Are you seeing something different?

@oromanos
Copy link
Author

oromanos commented Aug 18, 2017 via email

@kartik-v
Copy link
Owner

Ok I am adding a series of enhancements. Refer new issue for that #1048.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants