Uploading large files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Uploading large files

cnantais
What's the smartest way to handle the uploading of large files (>50mb)
through Seaside and onto the filesystem without grossly inflating my
image's memory consumption in the process?

Thanks in advance,

Chad
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

Patrick Collison
On 14/08/07, Chad Nantais <[hidden email]> wrote:
> What's the smartest way to handle the uploading of large files (>50mb)
> through Seaside and onto the filesystem without grossly inflating my
> image's memory consumption in the process?

I'm no expert, but I think the short answer is that you can't.

Maybe you could do it by interacting directly with the web-server, and
incrementally writing the file to disk?

Patrick

> Thanks in advance,
>
> Chad
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

Janko Mivšek
Swazoo 2.0 beta2 web server supports now an input streaming, that is,
streaming of http post data directly to the output stream, a file for
instance. That is what you need for uploading large files.

More on: http://www.swazoo.org/streaming.html

So, what is still needed is that Seaside connects to that new Swazoo and
you'll have large file uploads supported.

Best regards
Janko

Patrick Collison wrote:

> On 14/08/07, Chad Nantais <[hidden email]> wrote:
>> What's the smartest way to handle the uploading of large files (>50mb)
>> through Seaside and onto the filesystem without grossly inflating my
>> image's memory consumption in the process?
>
> I'm no expert, but I think the short answer is that you can't.
>
> Maybe you could do it by interacting directly with the web-server, and
> incrementally writing the file to disk?
>
> Patrick
>
>> Thanks in advance,
>>
>> Chad


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

cnantais
Janko,

Sounds good.  However, are you saying that Seaside does not connect to
this new version of Swazoo yet?


On 8/14/07, Janko Mivšek <[hidden email]> wrote:

> Swazoo 2.0 beta2 web server supports now an input streaming, that is,
> streaming of http post data directly to the output stream, a file for
> instance. That is what you need for uploading large files.
>
> More on: http://www.swazoo.org/streaming.html
>
> So, what is still needed is that Seaside connects to that new Swazoo and
> you'll have large file uploads supported.
>
> Best regards
> Janko
>
> Patrick Collison wrote:
> > On 14/08/07, Chad Nantais <[hidden email]> wrote:
> >> What's the smartest way to handle the uploading of large files (>50mb)
> >> through Seaside and onto the filesystem without grossly inflating my
> >> image's memory consumption in the process?
> >
> > I'm no expert, but I think the short answer is that you can't.
> >
> > Maybe you could do it by interacting directly with the web-server, and
> > incrementally writing the file to disk?
> >
> > Patrick
> >
> >> Thanks in advance,
> >>
> >> Chad
>
>
> --
> Janko Mivšek
> AIDA/Web
> Smalltalk Web Application Server
> http://www.aidaweb.si
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


--
Chad Nantais

http://myspace.com/chadnantais
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

Janko Mivšek
Hi Chad,

Chad Nantais wrote:

> Sounds good.  However, are you saying that Seaside does not connect to
> this new version of Swazoo yet?

Yes. On VW Swazoo 1.0 is connected, while on Squeak noone is. I
therefore suggest that someone start doing that, maybe on Squeak first.
He can count on all my support.

Best regards
Janko


> On 8/14/07, Janko Mivšek <[hidden email]> wrote:
>> Swazoo 2.0 beta2 web server supports now an input streaming, that is,
>> streaming of http post data directly to the output stream, a file for
>> instance. That is what you need for uploading large files.
>>
>> More on: http://www.swazoo.org/streaming.html
>>
>> So, what is still needed is that Seaside connects to that new Swazoo and
>> you'll have large file uploads supported.
>>
>> Best regards
>> Janko
>>
>> Patrick Collison wrote:
>>> On 14/08/07, Chad Nantais <[hidden email]> wrote:
>>>> What's the smartest way to handle the uploading of large files (>50mb)
>>>> through Seaside and onto the filesystem without grossly inflating my
>>>> image's memory consumption in the process?
>>> I'm no expert, but I think the short answer is that you can't.
>>>
>>> Maybe you could do it by interacting directly with the web-server, and
>>> incrementally writing the file to disk?
>>>
>>> Patrick
>>>
>>>> Thanks in advance,
>>>>
>>>> Chad
>>


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

mkobetic-2
In reply to this post by cnantais
If you are using VW, the new Seaside-Opentalk (note, we renamed the packages from SeasideForOpentalk to Seaside-Opentalk-*) will automatically stream any part of incoming request that has fileName specified in its header directly into a file. The default behavior is to save any such part into a configured directory under the provided name. If a file with that name exists already we will attach _v1 to the name for the new part, then _v2, etc. This behavior can be configured. Note that at this point we don't attempt to manage the contents of the directory in any way, we just create new files as they come in.

The way this works is that the component that parses incoming requests (HttpBuildHandler) has a bodyStreamBlock, which gets invoked before each simple body is read from the socket and is expected to create a stream to write the body into. The block receives a MimeEntity corresponding to the part being processed (with headers) and the builder (useful to access any configuration parameters) as arguments. It is up to the block to decide if an internal or external stream is created. To change the default block, you have to modify builderBlock on your SeasideTransportConfiguration. This is another block because there's a new builder instance created for each incoming request. The builderBlock is responsible for creating new builder instances, so you can set a new bodyStreamBlock on the builder instance directly in the builderBlock.

For any part of an incoming request that has a fileName we will create a WAFileStream (instead of WAFile). It is a trivial extension of WAFile which maintains its contents as a stream instead of a collection (byte array or string). WAFile would force us to read the contents of the files into memory when we create WARequest, obviously defeating the purpose of the optimizations described above. Note however that using #contents on WAFileStream will trigger reading of the whole file (currently every time you send it #contents). I'm not sure if and how often that happens once the WARequest is handed off to Seaside. I think it would be preferable to modify WAFile to use a stream internally and modify all such places to use the stream instead of #contents. Of course you should also avoid using #contents in your fileUploadWithCallback: callbacks as well, use WAFileStream>>stream instead.

If you have any comments about the solution I described above, please let me know.

Thanks,

Martin

Chad Nantais wrote:

> What's the smartest way to handle the uploading of large files (>50mb)
> through Seaside and onto the filesystem without grossly inflating my
> image's memory consumption in the process?
>
> Thanks in advance,
>
> Chad
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

cnantais
In reply to this post by Janko Mivšek
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.

Chad

On 8/14/07, Janko Mivšek <[hidden email]> wrote:

> Hi Chad,
>
> Chad Nantais wrote:
>
> > Sounds good.  However, are you saying that Seaside does not connect to
> > this new version of Swazoo yet?
>
> Yes. On VW Swazoo 1.0 is connected, while on Squeak noone is. I
> therefore suggest that someone start doing that, maybe on Squeak first.
> He can count on all my support.
>
> Best regards
> Janko
>
>
> > On 8/14/07, Janko Mivšek <[hidden email]> wrote:
> >> Swazoo 2.0 beta2 web server supports now an input streaming, that is,
> >> streaming of http post data directly to the output stream, a file for
> >> instance. That is what you need for uploading large files.
> >>
> >> More on: http://www.swazoo.org/streaming.html
> >>
> >> So, what is still needed is that Seaside connects to that new Swazoo and
> >> you'll have large file uploads supported.
> >>
> >> Best regards
> >> Janko
> >>
> >> Patrick Collison wrote:
> >>> On 14/08/07, Chad Nantais <[hidden email]> wrote:
> >>>> What's the smartest way to handle the uploading of large files (>50mb)
> >>>> through Seaside and onto the filesystem without grossly inflating my
> >>>> image's memory consumption in the process?
> >>> I'm no expert, but I think the short answer is that you can't.
> >>>
> >>> Maybe you could do it by interacting directly with the web-server, and
> >>> incrementally writing the file to disk?
> >>>
> >>> Patrick
> >>>
> >>>> Thanks in advance,
> >>>>
> >>>> Chad
> >>
>
>
> --
> Janko Mivšek
> AIDA/Web
> Smalltalk Web Application Server
> http://www.aidaweb.si
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


--
Chad Nantais

http://myspace.com/chadnantais
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Uploading large files

Boris Popov, DeepCove Labs (SNN)
How bad does your memory consumption go up when you upload 50M? I'm looking forward to using Opentalk based brokers in VisualWorks, but until then making sure I release all references to the resulting byte array works well enough so that space gets reclaimed immediately.

Cheers,

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Chad Nantais
> Sent: Tuesday, August 14, 2007 8:37 AM
> To: Seaside - general discussion
> Subject: Re: [Seaside] Uploading large files
>
> 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.
>
> Chad
>
> On 8/14/07, Janko Mivšek <[hidden email]> wrote:
> > Hi Chad,
> >
> > Chad Nantais wrote:
> >
> > > Sounds good.  However, are you saying that Seaside does not connect to
> > > this new version of Swazoo yet?
> >
> > Yes. On VW Swazoo 1.0 is connected, while on Squeak noone is. I
> > therefore suggest that someone start doing that, maybe on Squeak first.
> > He can count on all my support.
> >
> > Best regards
> > Janko
> >
> >
> > > On 8/14/07, Janko Mivšek <[hidden email]> wrote:
> > >> Swazoo 2.0 beta2 web server supports now an input streaming, that is,
> > >> streaming of http post data directly to the output stream, a file for
> > >> instance. That is what you need for uploading large files.
> > >>
> > >> More on: http://www.swazoo.org/streaming.html
> > >>
> > >> So, what is still needed is that Seaside connects to that new Swazoo
> and
> > >> you'll have large file uploads supported.
> > >>
> > >> Best regards
> > >> Janko
> > >>
> > >> Patrick Collison wrote:
> > >>> On 14/08/07, Chad Nantais <[hidden email]> wrote:
> > >>>> What's the smartest way to handle the uploading of large files
> (>50mb)
> > >>>> through Seaside and onto the filesystem without grossly inflating
> my
> > >>>> image's memory consumption in the process?
> > >>> I'm no expert, but I think the short answer is that you can't.
> > >>>
> > >>> Maybe you could do it by interacting directly with the web-server,
> and
> > >>> incrementally writing the file to disk?
> > >>>
> > >>> Patrick
> > >>>
> > >>>> Thanks in advance,
> > >>>>
> > >>>> Chad
> > >>
> >
> >
> > --
> > Janko Mivšek
> > AIDA/Web
> > Smalltalk Web Application Server
> > http://www.aidaweb.si
> > _______________________________________________
> > Seaside mailing list
> > [hidden email]
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
>
>
> --
> Chad Nantais
>
> http://myspace.com/chadnantais
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

Janko Mivšek
In reply to this post by cnantais
Chad,

Chad Nantais wrote:

> Do you know if this would require a major effort (making Swazoo 2.0
> work on Squeak Seaside) or a small one?

I would say a small one. Swazoo 1.0 is already connected on VW and this
can be an example to follow on Squeak too. And 2.0 has just slightly
different API than 1.0.

> 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.

Input streaming is not easy to do right, therefore I would rather
recommend to go the Swazoo way, because all particularities of MIME
parsing directly from the TCP stream to the output one are already solved.

Best regards
Janko


> On 8/14/07, Janko Mivšek <[hidden email]> wrote:
>> Hi Chad,
>>
>> Chad Nantais wrote:
>>
>>> Sounds good.  However, are you saying that Seaside does not connect to
>>> this new version of Swazoo yet?
>> Yes. On VW Swazoo 1.0 is connected, while on Squeak noone is. I
>> therefore suggest that someone start doing that, maybe on Squeak first.
>> He can count on all my support.
>>
>> Best regards
>> Janko
>>
>>
>>> On 8/14/07, Janko Mivšek <[hidden email]> wrote:
>>>> Swazoo 2.0 beta2 web server supports now an input streaming, that is,
>>>> streaming of http post data directly to the output stream, a file for
>>>> instance. That is what you need for uploading large files.
>>>>
>>>> More on: http://www.swazoo.org/streaming.html
>>>>
>>>> So, what is still needed is that Seaside connects to that new Swazoo and
>>>> you'll have large file uploads supported.
>>>>
>>>> Best regards
>>>> Janko
>>>>
>>>> Patrick Collison wrote:
>>>>> On 14/08/07, Chad Nantais <[hidden email]> wrote:
>>>>>> What's the smartest way to handle the uploading of large files (>50mb)
>>>>>> through Seaside and onto the filesystem without grossly inflating my
>>>>>> image's memory consumption in the process?
>>>>> I'm no expert, but I think the short answer is that you can't.
>>>>>
>>>>> Maybe you could do it by interacting directly with the web-server, and
>>>>> incrementally writing the file to disk?
>>>>>
>>>>> Patrick
>>>>>
>>>>>> Thanks in advance,
>>>>>>
>>>>>> Chad


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

Philippe Marschall
In reply to this post by mkobetic-2
2007/8/14, Martin Kobetic <[hidden email]>:
> If you are using VW, the new Seaside-Opentalk (note, we renamed the packages from SeasideForOpentalk to Seaside-Opentalk-*) will automatically stream any part of incoming request that has fileName specified in its header directly into a file. The default behavior is to save any such part into a configured directory under the provided name. If a file with that name exists already we will attach _v1 to the name for the new part, then _v2, etc. This behavior can be configured. Note that at this point we don't attempt to manage the contents of the directory in any way, we just create new files as they come in.
>
> The way this works is that the component that parses incoming requests (HttpBuildHandler) has a bodyStreamBlock, which gets invoked before each simple body is read from the socket and is expected to create a stream to write the body into. The block receives a MimeEntity corresponding to the part being processed (with headers) and the builder (useful to access any configuration parameters) as arguments. It is up to the block to decide if an internal or external stream is created. To change the default block, you have to modify builderBlock on your SeasideTransportConfiguration. This is another block because there's a new builder instance created for each incoming request. The builderBlock is responsible for creating new builder instances, so you can set a new bodyStreamBlock on the builder instance directly in the builderBlock.
>
> For any part of an incoming request that has a fileName we will create a WAFileStream (instead of WAFile). It is a trivial extension of WAFile which maintains its contents as a stream instead of a collection (byte array or string). WAFile would force us to read the contents of the files into memory when we create WARequest, obviously defeating the purpose of the optimizations described above. Note however that using #contents on WAFileStream will trigger reading of the whole file (currently every time you send it #contents). I'm not sure if and how often that happens once the WARequest is handed off to Seaside. I think it would be preferable to modify WAFile to use a stream internally and modify all such places to use the stream instead of #contents. Of course you should also avoid using #contents in your fileUploadWithCallback:

fileUploadWithCallback:?
Do you use Seaside 2.6?

> callbacks as well, use WAFileStream>>stream instead.

The only senders of #contents I could find so far are tests and WAFileLibrary.

Cheers
Philippe

> If you have any comments about the solution I described above, please let me know.
>
> Thanks,
>
> Martin
>
> Chad Nantais wrote:
> > What's the smartest way to handle the uploading of large files (>50mb)
> > through Seaside and onto the filesystem without grossly inflating my
> > image's memory consumption in the process?
> >
> > Thanks in advance,
> >
> > Chad
> > _______________________________________________
> > Seaside mailing list
> > [hidden email]
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

Brian Brown-2
In reply to this post by Janko Mivšek
Avi ported Swazoo to squeak at a camp smalltalk in 2004 I think. On  
SqueakMap there are Swazoo-HTTP, Swazoo-Listener, and Swazoo-Server  
packages, and the Swazoo listener package was specifically created to  
work with Seaside.

That would be where I would start...


Brian

On Aug 14, 2007, at 10:54 AM, Janko Mivšek wrote:

> Chad,
>
> Chad Nantais wrote:
>
>> Do you know if this would require a major effort (making Swazoo 2.0
>> work on Squeak Seaside) or a small one?
>
> I would say a small one. Swazoo 1.0 is already connected on VW and  
> this can be an example to follow on Squeak too. And 2.0 has just  
> slightly different API than 1.0.
>
>> 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.
>
> Input streaming is not easy to do right, therefore I would rather  
> recommend to go the Swazoo way, because all particularities of MIME  
> parsing directly from the TCP stream to the output one are already  
> solved.
>
> Best regards
> Janko
>
>
>> On 8/14/07, Janko Mivšek <[hidden email]> wrote:
>>> Hi Chad,
>>>
>>> Chad Nantais wrote:
>>>
>>>> Sounds good.  However, are you saying that Seaside does not  
>>>> connect to
>>>> this new version of Swazoo yet?
>>> Yes. On VW Swazoo 1.0 is connected, while on Squeak noone is. I
>>> therefore suggest that someone start doing that, maybe on Squeak  
>>> first.
>>> He can count on all my support.
>>>
>>> Best regards
>>> Janko
>>>
>>>
>>>> On 8/14/07, Janko Mivšek <[hidden email]> wrote:
>>>>> Swazoo 2.0 beta2 web server supports now an input streaming,  
>>>>> that is,
>>>>> streaming of http post data directly to the output stream, a  
>>>>> file for
>>>>> instance. That is what you need for uploading large files.
>>>>>
>>>>> More on: http://www.swazoo.org/streaming.html
>>>>>
>>>>> So, what is still needed is that Seaside connects to that new  
>>>>> Swazoo and
>>>>> you'll have large file uploads supported.
>>>>>
>>>>> Best regards
>>>>> Janko
>>>>>
>>>>> Patrick Collison wrote:
>>>>>> On 14/08/07, Chad Nantais <[hidden email]> wrote:
>>>>>>> What's the smartest way to handle the uploading of large  
>>>>>>> files (>50mb)
>>>>>>> through Seaside and onto the filesystem without grossly  
>>>>>>> inflating my
>>>>>>> image's memory consumption in the process?
>>>>>> I'm no expert, but I think the short answer is that you can't.
>>>>>>
>>>>>> Maybe you could do it by interacting directly with the web-
>>>>>> server, and
>>>>>> incrementally writing the file to disk?
>>>>>>
>>>>>> Patrick
>>>>>>
>>>>>>> Thanks in advance,
>>>>>>>
>>>>>>> Chad
>
>
> --
> Janko Mivšek
> AIDA/Web
> Smalltalk Web Application Server
> http://www.aidaweb.si
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Uploading large files

Boris Popov, DeepCove Labs (SNN)
Well, there is a port of Swazoo 2.0 even AFAIK, its just that there are no Seaside bindings for it yet.

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Brian Brown
> Sent: Tuesday, August 14, 2007 10:55 AM
> To: Seaside - general discussion
> Subject: Re: [Seaside] Uploading large files
>
> Avi ported Swazoo to squeak at a camp smalltalk in 2004 I think. On
> SqueakMap there are Swazoo-HTTP, Swazoo-Listener, and Swazoo-Server
> packages, and the Swazoo listener package was specifically created to
> work with Seaside.
>
> That would be where I would start...
>
>
> Brian
>
> On Aug 14, 2007, at 10:54 AM, Janko Mivšek wrote:
>
> > Chad,
> >
> > Chad Nantais wrote:
> >
> >> Do you know if this would require a major effort (making Swazoo 2.0
> >> work on Squeak Seaside) or a small one?
> >
> > I would say a small one. Swazoo 1.0 is already connected on VW and
> > this can be an example to follow on Squeak too. And 2.0 has just
> > slightly different API than 1.0.
> >
> >> 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.
> >
> > Input streaming is not easy to do right, therefore I would rather
> > recommend to go the Swazoo way, because all particularities of MIME
> > parsing directly from the TCP stream to the output one are already
> > solved.
> >
> > Best regards
> > Janko
> >
> >
> >> On 8/14/07, Janko Mivšek <[hidden email]> wrote:
> >>> Hi Chad,
> >>>
> >>> Chad Nantais wrote:
> >>>
> >>>> Sounds good.  However, are you saying that Seaside does not
> >>>> connect to
> >>>> this new version of Swazoo yet?
> >>> Yes. On VW Swazoo 1.0 is connected, while on Squeak noone is. I
> >>> therefore suggest that someone start doing that, maybe on Squeak
> >>> first.
> >>> He can count on all my support.
> >>>
> >>> Best regards
> >>> Janko
> >>>
> >>>
> >>>> On 8/14/07, Janko Mivšek <[hidden email]> wrote:
> >>>>> Swazoo 2.0 beta2 web server supports now an input streaming,
> >>>>> that is,
> >>>>> streaming of http post data directly to the output stream, a
> >>>>> file for
> >>>>> instance. That is what you need for uploading large files.
> >>>>>
> >>>>> More on: http://www.swazoo.org/streaming.html
> >>>>>
> >>>>> So, what is still needed is that Seaside connects to that new
> >>>>> Swazoo and
> >>>>> you'll have large file uploads supported.
> >>>>>
> >>>>> Best regards
> >>>>> Janko
> >>>>>
> >>>>> Patrick Collison wrote:
> >>>>>> On 14/08/07, Chad Nantais <[hidden email]> wrote:
> >>>>>>> What's the smartest way to handle the uploading of large
> >>>>>>> files (>50mb)
> >>>>>>> through Seaside and onto the filesystem without grossly
> >>>>>>> inflating my
> >>>>>>> image's memory consumption in the process?
> >>>>>> I'm no expert, but I think the short answer is that you can't.
> >>>>>>
> >>>>>> Maybe you could do it by interacting directly with the web-
> >>>>>> server, and
> >>>>>> incrementally writing the file to disk?
> >>>>>>
> >>>>>> Patrick
> >>>>>>
> >>>>>>> Thanks in advance,
> >>>>>>>
> >>>>>>> Chad
> >
> >
> > --
> > Janko Mivšek
> > AIDA/Web
> > Smalltalk Web Application Server
> > http://www.aidaweb.si
> > _______________________________________________
> > Seaside mailing list
> > [hidden email]
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

mkobetic-2
In reply to this post by Philippe Marschall
Philippe Marschall wrote:
> fileUploadWithCallback:?
> Do you use Seaside 2.6?

No. I got that from the WAUploadTest in the VW port of Seaside 2.7. We're focusing on 2.7 in our initial efforts, because there is a timeline that we'd like to follow with the intial release and from what I've heard 2.8 is still too much of a moving target.

On the other hand we definitely want to keep an eye on 2.8 developments, so if you can provide some pointers, I'd certainly like to take a look at how this works in 2.8.

> The only senders of #contents I could find so far are tests and WAFileLibrary.

That's great news. Thanks!

Martin

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

Philippe Marschall
2007/8/14, Martin Kobetic <[hidden email]>:
> Philippe Marschall wrote:
> > fileUploadWithCallback:?
> > Do you use Seaside 2.6?
>
> No. I got that from the WAUploadTest in the VW port of Seaside 2.7. We're focusing on 2.7 in our initial efforts, because there is a timeline that we'd like to follow with the intial release and from what I've heard 2.8 is still too much of a moving target.

Kinda depends. We have one major open bug which prevents us from
freezing the code and going beta. Besides that there is one big change
pending which might or might not make it into 2.8. But nothing is set
in stone so far.

The reason I was asking is because #fileUploadWithCallback: is part of
the old renderer which is deprecated in Seaside 2.7.

Cheers
Philippe

> On the other hand we definitely want to keep an eye on 2.8 developments, so if you can provide some pointers, I'd certainly like to take a look at how this works in 2.8.
>
> > The only senders of #contents I could find so far are tests and WAFileLibrary.
>
> That's great news. Thanks!
>
> Martin
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

Colin Putney
In reply to this post by cnantais

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
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

Streaming.1.cs (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

mkobetic-2
In reply to this post by Philippe Marschall
Philippe Marschall wrote:
> Kinda depends. We have one major open bug which prevents us from
> freezing the code and going beta. Besides that there is one big change
> pending which might or might not make it into 2.8. But nothing is set
> in stone so far.

Hm, I understand the "not in stone" part, but is there any expected timeline on 2.8 ? I have one more topic that I'd still like to discuss, Seaside's "streaming hooks". We're working on getting that set up with 2.7 and are running into some fairly significant obstacles with the whole WAStreamingResponse setup. I have yet to review the 2.8 version to see if anything has changed there, so I didn't want to start before wrapping my head around that. Sounds like I better get to it sooner than later.

Cheers,

Martin

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Uploading large files

Boris Popov, DeepCove Labs (SNN)
As a side note, we've moved our production application to 2.8 on July 7
and really haven't had any issues worth noting once the port was
complete, so I would definitely keep it in mind as far as any ongoing
work on Opentalk is concerned.

Cheers,

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Martin Kobetic
> Sent: Tuesday, August 14, 2007 3:15 PM
> To: Seaside - general discussion
> Subject: Re: [Seaside] Uploading large files
>
> Philippe Marschall wrote:
> > Kinda depends. We have one major open bug which prevents us from
> > freezing the code and going beta. Besides that there is one big
change
> > pending which might or might not make it into 2.8. But nothing is
set
> > in stone so far.
>
> Hm, I understand the "not in stone" part, but is there any expected
> timeline on 2.8 ? I have one more topic that I'd still like to
discuss,
> Seaside's "streaming hooks". We're working on getting that set up with
2.7
> and are running into some fairly significant obstacles with the whole
> WAStreamingResponse setup. I have yet to review the 2.8 version to see
if
> anything has changed there, so I didn't want to start before wrapping
my

> head around that. Sounds like I better get to it sooner than later.
>
> Cheers,
>
> Martin
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

Philippe Marschall
In reply to this post by mkobetic-2
2007/8/15, Martin Kobetic <[hidden email]>:
> Philippe Marschall wrote:
> > Kinda depends. We have one major open bug which prevents us from
> > freezing the code and going beta. Besides that there is one big change
> > pending which might or might not make it into 2.8. But nothing is set
> > in stone so far.
>
> Hm, I understand the "not in stone" part, but is there any expected timeline on 2.8 ?

We don't like to present timelines because it generally doesn't work
out as we plan. The original plan informally had ESUG 2007 as a
release date which turned into ESUG 2007 as beta. Now it looks as if
the whole redirection stuff will not be fixed before ESUG. You'd have
to ask Lukas how long he thinks I takes him to fix it. If we integrate
the url refactoring that would take some additional time and has the
potential to introduce some destabilization. Personally I'm for
dropping stuff from the 2.8 todo list and postponing it to 2.9 but
that's not a decision I can make alone.

> I have one more topic that I'd still like to discuss, Seaside's "streaming hooks". We're working on getting that set up with 2.7 and are running into some fairly significant obstacles with the whole WAStreamingResponse setup. I have yet to review the 2.8 version to see if anything has changed there, so I didn't want to start before wrapping my head around that. Sounds like I better get to it sooner than later.

Response streaming tends to work really bad together with
continutations (WATask, "clever" decorations like
WABasicAuthentication ....). Honestly I don't know how much action
WAStreamingResponse has seen.

Cheers
Philippe

> Cheers,
>
> Martin
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

cnantais
In reply to this post by Colin Putney
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 <[hidden email]> 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
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>


--
Chad Nantais

http://myspace.com/chadnantais
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Uploading large files

cnantais
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@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@lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>


--
Chad Nantais

http://myspace.com/chadnantais
_______________________________________________
Seaside mailing list
Seaside@lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
12