Live data from Hacker News

How to allow direct file uploads from JavaScript to Amazon S3 signed by Python

philfreo.com

1–10 of 14 posts

Re: How to allow direct file uploads from JavaScript to Amazon S3 signed by Python

#3
Does anyone know if the same thing is possible for Azure Blob Storage? I don't believe it is now, due to the Cross Origin Resource Sharing (CORS) limitations of Azure (http://social.msdn.microsoft.com/Forums/en-US/windowsazureda...), but I'd like to double check.

Re: How to allow direct file uploads from JavaScript to Amazon S3 signed by Python

#5

Does anyone know if the same thing is possible for Azure Blob Storage? I don't believe it is now, due to the Cross Origin Resource Sharing (CORS) limitations of Azure ( http://social.msdn.microsoft.com/Forums/en-US/windowsazureda... ), but I'd like to double check.

I guess it's redundant for me to reply here and say no, since I'm the one saying that on the forum thread you link to also. :-)

Re: How to allow direct file uploads from JavaScript to Amazon S3 signed by Python

#6
But does this mean Javascript is talking to your server rather than S3?

Because the beauty of filepicker is that a user is not locking up one of your processes while they spend minutes uploading a file.

Especially important on Heroku, for example. Though I'm sure a self hosted node server could fare better, I'd sooner stick it out with Filepicker.

Re: How to allow direct file uploads from JavaScript to Amazon S3 signed by Python

#8
post #6

But does this mean Javascript is talking to your server rather than S3? Because the beauty of filepicker is that a user is not locking up one of your processes while they spend minutes uploading a file. Especially important on Heroku, for example. Though I'm sure a self hosted node server could fare better, I'd sooner stick it out with Filepicker.

You construct the form server side but the file is uploaded from the client to S3 directly without passing through your server. It has been the best way to upload files to the internet for a long time.

Re: How to allow direct file uploads from JavaScript to Amazon S3 signed by Python

#9
post #7

How is it 'direct' if there is an intermediary?

It isn't an intermediary: you get a signature from your server (no actual file data sent) and then you use S3's support for direct browser uploads to send the actual file data.

One additional point to note: this has been possible since 2008 (see http://aws.amazon.com/articles/1434) and strictly speaking doesn't need CORS. If you use a hidden FORM element that targets a hidden iframe you can do this without needing a browser that supports CORS: you do lose the upload progress information, however.

Re: How to allow direct file uploads from JavaScript to Amazon S3 signed by Python

#10
post #6

But does this mean Javascript is talking to your server rather than S3? Because the beauty of filepicker is that a user is not locking up one of your processes while they spend minutes uploading a file. Especially important on Heroku, for example. Though I'm sure a self hosted node server could fare better, I'd sooner stick it out with Filepicker.

No... the file goes directly to S3 from the browser. Your server is only pinged with the _name_ of the file so the upload can be signed.
Post reply on HN