Shai from codename one helped me to upload an image to s3 bucket and I am able to upload images and I happen to notice that when I access the image from browser I am getting Access denied error.
The image was loading fine on the mobile app, the same image throws Access denied error in the web browser.
this is my code:
String strImage = Capture.capturePhoto(width, -1);
String s3Bucket = "https://s3.amazonaws.com/MyBuckt/";
String fileName = "Images/1234567";
MultipartRequest rq = new MultipartRequest();
rq.setUrl(s3Bucket);
rq.addArgumentNoEncoding("key", fileName);
rq.addArgument("acl", "public-read-write"); // here I give read-write access
rq.addData("file", strImage, "image/jpeg");
NetworkManager.getInstance().addToQueue();
When I launched S3 Browser and I do see the file and when I click on the file I get Access denied pop up message. The bucket and the folder has been given full grant permission as well as sub folders.
- The image is captured by the phone camera.
Any help is appreciated.