[Seaside] Uploading large files

cnantais cnantais at gmail.com
Sun Aug 19 16:32:27 UTC 2007


Thanks, Colin.

It's working, however it is taking about 60 seconds to upload a 5mb mp3 file
and up to 98% of my CPU.  Then the temp file actually ends up being larger
than the original by about 20% and is corrupt. It's the same for mp3s,
images, other binary types, but not text files.

Chad


Colin Putney wrote:
> 
> 
> On Aug 15, 2007, at 2:16 PM, cnantais wrote:
> 
>> So, I changed it to this:
>>
>> WATempFile>>initializeFromChunk: aChunk
>> 	fileName _ aChunk fileName.
>> 	contentType _ aChunk contentType.
>> 	(self tempDirectory
>> 		forceNewFileNamed: self tempFileName)
>> 		do: [:f | fileSize _ aChunk saveToStream: f]
>>
>> And it now works, almost.  I'm seeing no increase in memory  
>> consumption when
>> I submit an upload of a 10mb mp3 file. Only problem is that it is  
>> creating
>> zero-byte files in the 'tmp' directory when I upload something,  
>> like so:
> 
> Oops. #forceNewFileNamed:do: is peculiar to my image - that  
> definitely won't work in a stock image. I'm surprised that what  
> you've got there doesn't throw an error. It should be something like  
> this:
> 
> WATempFile>>initializeFromChunk: aChunk
> 	fileName _ aChunk fileName.
> 	contentType _ aChunk contentType.
> 	f := self tempDirectory forceNewFileNamed: self tempFileName.
> 	[fileSize := aChunk saveToStream: f]
> 		ensure: [f close]
> 
> Colin
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> 
> 

-- 
View this message in context: http://www.nabble.com/Uploading-large-files-tf4265297.html#a12223751
Sent from the Squeak - Seaside mailing list archive at Nabble.com.



More information about the seaside mailing list