Re: WAStreamingResponse or WAComboResponse for a single callback?

Sven Van Caekenberghe <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <[email protected]>
Jupiter,

What is large for you ? 

I think it is not easy to prevent Seaside from taking everything into memory.

Zinc can do what you want, using a ZnStreamingEntity plugged into a ZnResponse, if that is an option for you (you could run an extra server in the same image on a different port, or you could play with prefixes).

Have a look at ZnStaticFileServerDelegate>>#responseForFile:fromRequest:

This method does more than just plain serving the file, but you should be able to see what you want.

Sven

> On 6 Jan 2017, at 20:41, Jupiter Jones <[email protected]> wrote:
> 
> Hi Petr,
> 
> Thanks for the link, however, it’s large downloads via the image I’m looking to solve.
> 
> I know it’s not ideal to serve large files via the image, however, in this case I need to accommodate them.
> 
> I’ll keep looking.
> 
> Thanks again for your response.
> 
> Cheers,
> 
> J
> 
>> On 6 Jan 2017, at 11:48 am, Petr Fischer <[email protected]> wrote:
>> 
>> Some blog post about large uploads:
>> http://jbrichau.github.io/blog/large-file-upload-in-seaside
>> 
>> pf
>> 
>> 
>>> Hi Seasiders,
>>> 
>>> I have a callback that downloads a file which works perfectly until the file size becomes to large and it runs out of memory.
>>> 
>>> My response method looks like this:
>>> 
>>> response
>>>   attachmentWithFileName: target name;
>>>   contentType: target mimeType;
>>>   binary;
>>>   doNotCache.
>>> target
>>>   readOnlyFileDo: [ :file | 
>>>     [ file atEnd ]
>>>       whileFalse: [ 
>>>         | byteArray |
>>>         byteArray := ByteArray new.
>>>         file read: 4096 into: byteArray.
>>>         response stream nextPutAll: byteArray.
>>>         response flush ] ]
>>> 
>>> I can see that a WABufferedResponse does nothing with #flush so I’m wanting to use either the WAComboResponse or the WAStreamingResponse for this callback. However, I can’t see how to configure a single response to use either of these classes.
>>> 
>>> From what I can see, it looks like the response is configured in the server adaptor. Since this single download callback is the only request that needs to stream it’s response, is there a way to use a WACombeResponse or a WAStreaming response for one particular callback?
>>> 
>>> Any advice would be greatly appreciated.
>>> 
>>> Cheers,
>>> 
>>> Jupiter
>>> _______________________________________________
>>> seaside mailing list
>>> [email protected]
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>> _______________________________________________
>> seaside mailing list
>> [email protected]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> 
> _______________________________________________
> seaside mailing list
> [email protected]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[email protected]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.