0

I upload files to AWS S3 server wth that code:

private void beginUpload(String filePath) {
        if (filePath == null) {
            Toast.makeText(this, "Could not find the filepath of the selected file",
                    Toast.LENGTH_LONG).show();
            return;
        }
        File file = new File(filePath);
        TransferObserver observer = transferUtility.upload(AWSConfiguration.BUCKET_NAME, file.getName(),
                file);

    }

Before uploading I want to resize an image (not on my phone but only on server) to occupy less memory. How to do it?

John Leszcz
  • 93
  • 1
  • 3
  • 11

1 Answers1

1

assuming yout file is bitmap lets create Bitmap object like HERE and then resize it like HERE. Create new file with resized bitmap like HERE, send it and remove file on the end.

Community
  • 1
  • 1
snachmsm
  • 17,866
  • 3
  • 32
  • 74