[Seaside] [ENH] Large file upload patch (remake)

Göran Krampe goran at krampe.se
Sun Apr 6 23:38:59 UTC 2008

Hi folks!

Ok, this came up once again on IRC - how to do chunkwise uploading and
thus continously write to a file and handle LARGE files.

I googled and first I found Colin Curtin writing code for this (and also
streamed downloading code) back in 2004! Might be worth looking at more
closely. I also found Colin Putney's code from aug 2007, which seems to
originate from DabbleDB (I guess) - Squeak 3.7.

I more or less took Colin's approach, rewrote the low level bit (so that
it does not end up doing bytewise searching as I presume Colin's code
does) and more or less copied WATempFile as is. The multipartFormFieldsDo:
code now ALWAYS uses WATempFile, regardless if it has a file name or not -
and regardless of how small they are. This could of course be discussed.

But the MAIN THING is this:

Upload of 295Mb file (locally) on a box with tinyBenchmarks ('117972350
bytecodes/sec; 4788828 sends/sec') took around 45 seconds. Uploading
squeak.image which was 16Mb took 2 seconds or so. CPU load kinda high
(profile shows that it is the copying from the buffer into FileStream) but
no visible memory consumption.

I also noted that this is being recently discussed too - but hey, I had
already started coding and wanted to finish it :).

regards, Göran
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StreamedUpload.4.cs.gz
Type: application/gzip
Size: 2662 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20080407/55aab626/StreamedUpload.4.cs-0001.bin

More information about the seaside mailing list