Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to upload with InputStream to S3 object instead of write all contents to a file to improve performance? #3355

Closed
FrankieCheng opened this issue Jul 12, 2023 · 1 comment
Labels
closing soon Issue will auto-close if there is no additional activity within 7 days. pending-community-response Issue is pending response from the issue requestor question General question s3 Issues with the AWS Android SDK for Simple Storage Service (S3).

Comments

@FrankieCheng
Copy link

State your question
We used the following code to write inputstream to S3, and is it possible to upload with InputStream to S3 object instead of write all contents to a file to improve performance?
/**

  • Starts uploading the inputStream to the given bucket, using the given key.
  • @param key The key in the specified bucket by which to store the new object.
  • @param inputStream The input stream to upload.
  • @param options An UploadOptions which hold all of the optional parameters
  •                  i.e. bucket, metadata, cannedAcl and transferListener.
    
  • @return A TransferObserver used to track upload progress and state
    */
    public TransferObserver upload(String key, InputStream inputStream, UploadOptions options) throws IOException {
    File file = writeInputStreamToFile(inputStream);
    return upload(
    options.getBucket() != null ? options.getBucket() : getDefaultBucketOrThrow(),
    key,
    file,
    options.getMetadata() != null ? options.getMetadata() : new ObjectMetadata(),
    options.getCannedAcl(),
    options.getTransferListener()
    );
    }

Which AWS Services are you utilizing?
S3

Provide code snippets (if applicable)

Environment(please complete the following information):

  • SDK Version: 2.71.0
    public TransferObserver upload(String key, InputStream inputStream, UploadOptions options) throws IOException {
    File file = writeInputStreamToFile(inputStream);

Device Information (please complete the following information):

  • Device: ALL
  • Android Version: ALL
  • Specific to simulators:
@mattcreaser mattcreaser added question General question s3 Issues with the AWS Android SDK for Simple Storage Service (S3). labels Jul 24, 2023
@ankpshah
Copy link
Contributor

ankpshah commented Jul 26, 2023

Hello @FrankieCheng. Currently this feature does not exist.

Amplify Android v1 is now in Maintenance Mode until May 31st, 2024.
This means that we will continue to include updates to ensure compatibility with backend services and security. No new features will be introduced in v1. More Details: https://docs.amplify.aws/lib-v1/q/platform/android/

But you can always raise a feature request in Amplify Android v2 here: https://github.com/aws-amplify/amplify-android/issues/new/choose . In the feature request, it will be helpful if could you provide more details about performance issue you are facing. It might help in better understanding the issue.

@ankpshah ankpshah added pending-community-response Issue is pending response from the issue requestor closing soon Issue will auto-close if there is no additional activity within 7 days. labels Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing soon Issue will auto-close if there is no additional activity within 7 days. pending-community-response Issue is pending response from the issue requestor question General question s3 Issues with the AWS Android SDK for Simple Storage Service (S3).
Projects
None yet
Development

No branches or pull requests

3 participants