5

Actually i need to upload multiple image same time in amazon s3 server. Here is my Single File upload code here::

TransferObserver transferObserver = transferUtility.upload(
                "selfiesharedev",     /* The bucket to upload to */
                mini_image_path,    /* The key for the uploaded object */
                file,        /* The file where the data to upload exists */
                CannedAccessControlList.PublicRead
        );
3
  • Possible duplicate of Uploading multiple images in webservice using PHP Commented Dec 7, 2016 at 5:50
  • 1
    finally I got Solution for multiupload android .am using this method aws.amazon.com/blogs/developer/… Commented Dec 10, 2016 at 7:39
  • This is what I've done to upload or download mutliple files concurrently. It's the complete code in Kotlin, may it help others who'll come here. Commented Jun 27, 2020 at 13:41

2 Answers 2

2

Please Check this out !

  TransferManager tm = new TransferManager(myCredentials);

    ObjectMetadataProvider metadataProvider = new ObjectMetadataProvider() {
        void provideObjectMetadata(File file, ObjectMetadata metadata) {
            // If this file is a JPEG, then parse some additional info
            // from the EXIF metadata to store in the object metadata
            if (isJPEG(file)) {
                metadata.addUserMetadata("original-image-date", 
                                         parseExifImageDate(file));
            }
        }
    }

    MultipleFileUpload upload = tm.uploadFileList(
            myBucket, myKeyPrefix, rootDirectory, fileList, metadataProvider);
Sign up to request clarification or add additional context in comments.

1 Comment

TransferManager and MultipleFileUpload are deprecated in java
0

You can use S3TransferUtility to achieve that. A sample can be found in: https://github.com/awslabs/aws-sdk-android-samples/tree/master/S3TransferUtilitySample

It's also good to read... https://github.com/awslabs/aws-sdk-android-samples/blob/master/S3TransferUtilitySample/S3TransferUtilityTutorial.md ... to understand the code in the sample.

1 Comment

thankz yaar. finally I got Solution for multiupload android .am using this method aws.amazon.com/blogs/developer/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.