Amazon S3: Is it possible to perform multipart upload file request using input stream?
-
I came across a few examples, where multi-part upload request is carried out using File Object. However, I wanted to know if it is possible to carry out the multi part upload using input stream instead of using file object. Please help.
-
Answer:
Only if you know the size of the stream ahead of time, which kind of defeats the purpose of the stream. Each part of a MultiPart upload is just a normal S3 upload and therefore needs to provide a Content-Length header in the initial request. The Google Storage service does support chunked transfer encoding and can accept streaming input.
Mitch Garnaat at Quora Visit the source
Other answers
Hi,You can use https://github.com/minio/mc, it handles multipart for you. For uploading via input stream you can use "$ mc pipe" command.EXAMPLES: 1. Write contents of stdin to a file on local filesystem. $ mc pipe /tmp/hello-world.go 2. Write contents of stdin to an object on Amazon S3 cloud storage. $ mc pipe s3/personalbuck/meeting-notes.txt 3. Copy an ISO image to an object on Amazon S3 cloud storage. $ cat debian-8.2.iso | mc pipe s3/ferenginar/gnuos.iso 4. Stream MySQL database dump to Amazon S3 directly. $ mysqldump -u root -p ******* accountsdb | mc pipe s3/ferenginar/backups/accountsdb-oct-9-2015.sql You can also use mc client libraries available in https://github.com/minio/minio-py, https://github.com/minio/minio-dotnet, https://github.com/minio/minio-java, https://github.com/minio/minio-go, https://github.com/minio/minio-js to do the same.Hope it helps.
Atul Jha
you can find sample code to upload file in multipart in java, without uisng AWS sdk http://dextercoder.blogspot.in/2012/02/multipart-upload-to-amazon-s3-in-three.html
Vishal Ghadge
Want to do multipart upload in S3 Java via InputStream .So,Content-length is not known to me.Also,using High Level Multipart Upload API,how to upload parts?
Avinash Kumar
Related Q & A:
- How to upload file to google cloud storage using Java?Best solution by Stack Overflow
- How to sequence events while uploading large files to Amazon S3?Best solution by Stack Overflow
- How I can validate input on form before upload file?Best solution by stackoverflow.com
- How to upload file using ajax php?Best solution by Stack Overflow
- How to get file properties from a post request using Slim?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.