How to upload multiple images to amazon webservice s3 (android) at the same time?

In fact, I need to upload multiple images at the same time on 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
        );
+4
source share
2 answers

Please check it!

  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);
+2
source

Source: https://habr.com/ru/post/1662269/


All Articles