Hi Daniel,

what error msg do you get? Have you tried 
increasing akka.http.server.parsing.max-content-length (reference 
<http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0/scala/http/configuration.html>
)

https://github.com/akka/akka/issues/18533 could be related here and was 
recently fixed.

Cheers
André

On Wednesday, October 7, 2015 at 9:30:08 AM UTC+2, Daniel Bauer wrote:
>
> I'm using akka http to implement a REST service and that works fine except 
> for one case. The HTTP message parser has a limit on the message size. This 
> means that I cannot upload "large" data using a simple POST message, 
> extract the "entity.dataBytes" and write that to a file. Is there a way how 
> I can get access to a "raw" stream such that it also works with arbitrary 
> file sizes? The simplistic solution below doesn't work for large data (due 
> to the message size limitation):
>
>   val routes = {
>     pathSingleSlash {
>       (post & extractRequest) { 
>         request => {
>           val source = request.entity.dataBytes
>           val outFile = new File("/tmp/outfile.dat")
>           val sink = SynchronousFileSink.create(outFile)
>           val repl = source.runWith(sink).map(x => s"Finished uploading 
> ${x} bytes!")
>           onSuccess(repl) { repl =>
>             complete(HttpResponse(status = StatusCodes.OK, entity = repl))
>           }
>         }
>       }
>     }
>   }
>
>   Http().bindAndHandle(routes, config.getString("http.interface"), 
> config.getInt("http.port"))
>
>
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to