Integrating Play application with Amazon S3
For this recipe, we will explore how Play applications can upload files directly to Amazon Web Services (AWS) S3, a popular cloud storage solution.
For more information about S3, please refer to http://aws.amazon.com/s3/.
How to do it…
For Java, we need to take the following steps:
- Run the
foo_javaapplication with Hot-Reloading enabled:
- Declare play-s3 as a project dependency in
"com.amazonaws" % "aws-java-sdk" % "1.3.11"
- Specify your AWS credentials in
aws.accessKeyId="YOUR S3 ACCESS KEY" aws.secretKey="YOUR S3 SECRET KEY" fooscala.s3.bucketName="YOUR S3 BUCKET NAME"
foo_java/app/controllers/Application.javaby adding the following code: ...