I want to upload an image to amazon s3 trash in Android. I have no errors, but it just doesnβt work, can someone help me? I cannot find any good examples or questions about this.
I assign the image "File images3"
images3 = new File(uri.getPath()); public void addEventToDB(){ Thread thread = new Thread() { @Override public void run() { try { CognitoCachingCredentialsProvider credentialsProvider = new CognitoCachingCredentialsProvider( getActivity().getApplicationContext(), // get the context for the current activity "...", "us-east-1:...", "arn:aws:iam::...:role/Cognito_WitpaAuth_DefaultRole", "arn:aws:iam::...:role/Cognito_WitpaAuth_DefaultRole", Regions.US_EAST_1 ); String bucket_name = "witpa"; String key = "images.jpeg"; TransferManager transferManager = new TransferManager(credentialsProvider); transferManager.upload(bucket_name, key, images3); } catch (Exception e) { e.printStackTrace(); } } }; thread.start(); }
I created my bucket, in the permissions that I set, so that everyone can write and read.
In amazon cognito, I just left everything by default.
Does anyone know how I can make this work?
source share