0
votes

I have created an Java web application and deployed it on AWS Elastic Beanstalk. It;s working fine with its database.

Now, in my project users have the option to upload documents, pdfs and images. This is creating problems. In the local system I am using ./ as the path for saving uploaded documents but on Amazon I don't know where to store these uploaded documents and how to assign a path.

So far I've done the following, which is all working okay.

  1. Uploaded a project on AWS Elastic Beanstalk.
  2. Created a database using AWS RDS.
  3. Both application and database are communicating with each other.
2

2 Answers

3
votes

To store files I suggest using a S3 bucket. Use the amazon SDK to do it. For java, see com.amazonaws.services.s3 putObject Interface AmazonS3.

Of course, your file-saving code should be pluggable, with at least two implementations. One implementation saving the file to the local disk and another for storing it in S3. Your startup code should wire the correct implementation.

0
votes

yes once you store it in (AWS) S3 bucket, get the credential details of it and create a credentials file

Much easier! :)