Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

Multipart Fileupload #21

Closed
mfentross opened this issue Apr 2, 2014 · 1 comment
Closed

Multipart Fileupload #21

mfentross opened this issue Apr 2, 2014 · 1 comment

Comments

@mfentross
Copy link

We are trying to implement an asynchronous action with Play 2.2.2 and Scala and wanted to enable our application to receive imges in form of a multiprt/form-data request. We are then trying to directly forward the received fileparts to s3 server but the Usage part of the documentation doesn't help us with this part. Anyone got an exampe Controller or idea of how to handle the direct upload?

@EECOLOR
Copy link
Member

EECOLOR commented Apr 2, 2014

I think it's easier to directly upload to S3 without going through your Play application. Checkout the article about Browser Uploads to S3 using HTML POST Forms. See the API reference docs for extra information.

The Play S3 library provides some methods to help create the form required for such an upload. Checkout the last part of the readme. For another example you can look at the appropriate test called "be able to supply an uploadPolicy that can be used to alow browser upload".

If you want to proxy the request through a controller you need to access the bytes of a file to pass them to the add method. More about his can be found in a stackoverflow answer at Pulling file from MultipartFormData in memory in Play2 / Scala.

@EECOLOR EECOLOR closed this as completed May 11, 2014
@EECOLOR EECOLOR mentioned this issue Sep 15, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants