-
Notifications
You must be signed in to change notification settings - Fork 254
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
Reuse File Input for a second upload #86
Comments
This repository is for the gem packaging of the jquery file upload gem. However, just instantiating the plugin won't trigger a file upload, that's why your current code is doing nothing. You should look into the Programmatic file upload section in the jQuery-File-Upload Wiki. |
Thank you for the link, I checked out the Programmatic file upload section. I tried to keep the code below and add a programmatic upload in the callback.
Which enters a loop of uploads. Not working. Then I thought about creating 2 different widgets to upload programmatically following the pattern:
But the 2 widgets end up referring to the same file input and that doesn't work either. I thought about an hacky solution, add a second hidden file input, create a second separate widget, and then populate the input field when the file is selected : but it is not possible to populate manually an input field with a file. Unfortunately I can't think of another way to proceed.. |
I am trying another approach for the multiple versions upload. The following code works fine.
I changed the processQueue to upload 2 versions in a row:
Problem: the first saveImage does not upload the first image before duplicating. Instead there is only one POST request issued for both files, which returns the error => POST requires exactly one file upload per request. Any idea how to fix this issue? Thx for your help. |
Shouldn't you be able to use |
@felixbuenemann Thanks again for your reply.
I could not fine SO threads mentioning resizing with 'send' and I could not find it in the wiki either, so if you have the solution to resize with 'send' that would be extremely helpful. Thanks again |
I am trying to upload 2 different versions of the same file to AWS S3 from a single form: large and thumbnail.
The code for the upload is the following. The upload works fine and in the done callback I would like to start the second upload.
The code for the startThumbnailUpload() method would be exactly the same except for the width and height:
The second fileInput.fileupload never gets executed. Is there a way to achieve that kind of double upload with the same file reusing the same fileinput?
The text was updated successfully, but these errors were encountered: