2

I am writing a web server with Play framework 2.6 in Java. I want to upload a file to WebServer through a multipart form and do some validations, then upload the file s3. The default implementation in play saves the file to a temporary file in the file system but I do no want to do that, I want to upload the file straight to AWS S3.

I looked into this tutorial, which explains how to save file the permanently in file system instead of using temporary file. To my knowledge I have to make a custom Accumulator or a Sink that saves the incoming ByteString(s) to a byte array? but I cannot find how to do so, can someone point me in the correct direction?

thanks

Jeffrey Chung
  • 19,319
  • 8
  • 34
  • 54
Bhanuka Yd
  • 646
  • 8
  • 25
  • Look at [Play documentation](https://www.playframework.com/documentation/2.5.x/JavaBodyParsers#custom-parsing-using-akka-streams) and [Scala answer] (https://stackoverflow.com/a/38480045/2571592). Hope it helps. – bischak Sep 21 '17 at 15:27
  • I got working code for S3 uploading, but with temp file, did you solve your problem? – cutoffurmind Sep 25 '17 at 12:11
  • nop not yet. I am looking for a java solution. Might have to learn how Akka works to write one – Bhanuka Yd Sep 25 '17 at 19:32

0 Answers0