John Leszcz John Leszcz - 1 year ago 142
Android Question

Android uploading image AWS- resize

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",
File file = new File(filePath);
TransferObserver observer = transferUtility.upload(AWSConfiguration.BUCKET_NAME, file.getName(),


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

Answer Source

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.