Reputation: 15262
I would like to know, if is it possible to use multipart upload to S3 via a web browser (low-level API)?
If that is the case are there any demo web apps with source code or tutorials?
Thanks in advance
References http://docs.amazonwebservices.com/AmazonS3/latest/dev/HLTrackProgressMPUJava.html
Upvotes: 1
Views: 2167
Reputation: 6945
The question appears to be about multi-part uploads from a browser, not single-part uploads.
Yes, you can do single-part uploads from a web browser using HTTP POST.
No, you cannot do a multi-part upload via a standard web browser, although such a thing might be possible using Flash/Silverlight. This will, of course, eliminate most mobile devices as well as any desktop users who have purposefully uninstalled these plugins (like me!).
Upvotes: 3
Reputation: 2377
It certainly is possible, look at http://sente.cc/upload_to_s3.html for a working example which uploads directly to S3 from the browser.
Also see https://stackoverflow.com/a/6912340/217652
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<h3>refresh the page after you've submitted to see your new image</h3>
<div style="width:300px">
<form action="http://s3.amazonaws.com/dev.sente" method="post" enctype="multipart/form-data">
<fieldset>
<input type="hidden" name="acl" value="public-read" /> <br />
<i>name of key:</i><input type="text" name="key" readonly="true" value="image.jpg" /> <br />
<input name="file" type="file" /> <br />
<input name="submit" value="Upload" type="submit" />
</fieldset>
</form>
</div>
<br />
<a href="http://s3.amazonaws.com/dev.sente/image.jpg">http://s3.amazonaws.com/dev.sente/image.jpg</a><br />
<a href="http://s3.amazonaws.com/dev.sente/image.jpg"><img src="http://s3.amazonaws.com/dev.sente/image.jpg" /></a>
</a>
</body>
</html>
Upvotes: -3
Reputation: 1979
From your question, it doesn't seem like you're looking for a solution in a specific language.
Anyway, there's a page on the official s3 docs that shows the browser-based uploads feature. It might help to check it out.
Upvotes: 1