This repository was archived by the owner on Dec 15, 2023. It is now read-only.
Patches for iframe-based uploads to Amazon S3 #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, I've been using your iframe-based uploader to send files to Amazon S3 direct from the browser and I've had to make a couple of small patches.
The first was to move the file input to the end of the form so that the file is the last field submitted: Amazon insist on this as they want to process your credentials and object parameters before they start processing your file data.
The second was to work around cross-domain iframe errors. If the upload is successful Amazon redirect the browser to a URL of your choosing so everything works fine. If the upload fails, however, Amazon don't redirect and so the iframe onLoad code throws a permission denied error when trying to read the iframe properties. I've wrapped this in a try ... catch and just create an empty file.response object if there's an error. You might have a better suggestion for how to handle this condition, but I think it's preferable to catch the error and let the calling code deal with it than to let it propagate.
Thanks for the awesome library!