[Seaside] Uploading large files

cnantais cnantais at gmail.com
Wed Aug 15 21:16:51 UTC 2007


By the way, Colin, UnixFileDirectory>>forceNewFileNamed:do: is getting called
in this method:

WATempFile>>initializeFromChunk: aChunk
	fileName _ aChunk fileName.
	contentType _ aChunk contentType.
	self tempDirectory
		forceNewFileNamed: self tempFileName 
		do: [:f | fileSize _ aChunk saveToStream: f]

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:

[contentType: 	'audio/mpeg'
readStream: 	nil
fileName: 	'test.mp3'
fileSize: 	nil
tempFileName: 	'5cf9e272-082b-4bf9-b593-d845fd25103f']

Maybe this has to do with the fact I created an empty WATempFile class and
the only methods in it are what your changeset added.  If you send me the
complete WATempFile class, I can try it again.

Thanks in advance,

Chad


cnantais wrote:
> 
> Thanks, Colin.  Here's what I did, and the result.
> 
> In a fresh sq3.9-7067web07.08.1.image...
> 1. Tried to file in streaming.1.cs, but first had to:
> 	a. file in FastSocketStream-gk.3.cs
> 	b. create class WATempFile
> 2. Created a simple file upload component.
> 3  Received this error after submitting the file upload form:
> [Internal Server Error
> MessageNotUnderstood: UnixFileDirectory>>forceNewFileNamed:do:
> Comanche/6.2 (Mac OS) Server at 'localhost' Port 8080]
> 
> Chad
> 
> 
> On 8/14/07, Colin Putney <cputney at wiresong.ca> wrote:
>>
>> On Aug 14, 2007, at 8:36 AM, Chad Nantais wrote:
>>
>> > Janko,
>> >
>> > Do you know if this would require a major effort (making Swazoo 2.0
>> > work on Squeak Seaside) or a small one?
>> >
>> > Or does anyone know if there's a way I can hack Kom to make it handle
>> > large uploads through input streaming?  Unfortunately, this is one of
>> > those instances where I may need to use something other than Seaside
>> > :cringe: if I can't get it working.
>>
>> I've done just such a hack. I *think* the attached change set has
>> everything you need. If not let me know.
>>
>> Colin
>>
>>
>>
>> _______________________________________________
>> Seaside mailing list
>> Seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>>
>>
> 
> 
> -- 
> Chad Nantais
> 
> http://myspace.com/chadnantais
> _______________________________________________
> 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#a12170570
Sent from the Squeak - Seaside mailing list archive at Nabble.com.



More information about the seaside mailing list