So, in my application, users will be able to upload their photos to the S3 repository, after which I will save the returned URL in the database.
The problem I am facing is that when I deploy the application in my Elastic Beanstalk environment, I can no longer store photos in S3 storage due to this error that I found in the catalina.out log:
java.io.IOException: Permission denied at java.io.UnixFileSystem.createFileExclusively(Native Method) at java.io.File.createNewFile(File.java:1012) at com.common.util.file.FileUtil.convert(FileUtil.java:17)
How can I set the resolution to fix this error?
[EDIT] When I run the application on the local host, I can upload the file to the S3 bucket. I used this sample code in this link as an implementation template for uploading a file.
Here is the code I use to convert a multi-page file to a file:
public File convert(MultipartFile file) throws IOException { File convFile = new File(file.getOriginalFilename()); convFile.createNewFile();
java amazon-s3 amazon-web-services amazon-ec2
dkn
source share