[Seaside] Uploading large files
Philippe Marschall
philippe.marschall at gmail.com
Sun Aug 19 09:09:44 UTC 2007
2007/8/19, Colin Putney <cputney at wiresong.ca>:
>
> 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:
Why is #do: on the class side and part of the selector? Putting it on
the instance side would make it work with all the instance creation
methods without duplication.
Cheers
Philippe
> 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
>
More information about the seaside
mailing list