Hi Charlie,
I'll try to reproduce the problem you described - it definitely should not 
happen, so we may be looking at a bug here.
Is there anything else other than the snippet (thanks for pasting it!) that 
might be related to the issue you're seeing?

Does the same happen if you replicate the posted data with curl (I'll use that 
now locally to simulate the same situation,
and would like to confirm it fails for you with curl as well)?

// And a sanity check - you are using Akka Streams 1.0 and Akka 2.1.12 (if not 
please upgrade)?

-- 
Cheers,
Konrad `ktoso` Malawski
Akka @ Typesafe

On 2 September 2015 at 14:46:11, Charlie Evans ([email protected]) 
wrote:

Hi all,

I'm trying to use Akka http for large files (300MB is what I'm currently 
testing) coming in as multi-part form data. The file gets written straight to 
disk. The file ends up being a few MB short of complete and the upload hangs 
indefinitely. I had a look at the files and the top and bottom match so it must 
have missed a chunk somewhere in between? How would I prevent this?

The code of interest is below:

val file = new File(localPath)

val sink = SynchronousFileSink(file)



entity(as[Multipart.FormData]) { (formdata: Multipart.FormData) =>

val fileNamesFuture = formdata.parts.mapAsync(1) { p =>

                    if (p.filename.isDefined) {

                      println(s"Got part. name: ${p.name} filename: 
${p.filename}")

                      p.entity.dataBytes.runWith(sink).map { bytesWritten => 

                        """{"result":"Finished upload"}""".parseJson

}

}



Thanks



--
>>>>>>>>>> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
>>>>>>>>>>      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 [email protected].
To post to this group, send email to [email protected].
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