<div dir="ltr"><div dir="ltr"><div>Hi Karsten,</div><div><br></div><div>I didn't think about an override and went subclassing directly (I'm not keen/not used to method overrides), but your approach of having a threshold seems like a good tradeoff to preserve the simplicity for small files.</div><div><br></div><div>What I couldn't find is whether the maximum request body size is enforced with Seaside (I placed a few breakpoints around senders of #requestBodyLimit without any luck).</div><div><br></div><div>Regards,</div><br clear="all"><div><div dir="ltr" class="gmail_signature">Esteban A. Maringolo</div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 8, 2019 at 1:59 PM Karsten Kusche <<a href="mailto:karsten@heeg.de">karsten@heeg.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div>
<div style="font-family:Helvetica,Arial;font-size:13px">Hi Esteban,</div>
<div style="font-family:Helvetica,Arial;font-size:13px"><br>
</div>
<div style="font-family:Helvetica,Arial;font-size:13px">we have an override in SeasideResponder>>asSeasideFileStream: where we do something differently in „stream isExternalStream ifTrue:[…]“</div>
<div style="font-family:Helvetica,Arial;font-size:13px"><br>
</div>
<div style="font-family:Helvetica,Arial;font-size:13px">There we ask the stream for #fileName (returns a Filename object) and test the file size. That’s the file that contains the data that was uploaded. If the file’s size exceeds a certain threshold we return
 a subclass of WAFile that knows the file and not its contents.</div>
<div style="font-family:Helvetica,Arial;font-size:13px"><br>
</div>
<div style="font-family:Helvetica,Arial;font-size:13px">Kind Regards</div>
<div style="font-family:Helvetica,Arial;font-size:13px">Karsten</div>
<br>
<div class="gmail-m_6646883934659480719gmail_signature">
<pre style="font-size:14px"><pre>Georg Heeg eK
Wallstraße 22
06366 Köthen

Tel.: 03496/214328
FAX: 03496/214712
Amtsgericht Dortmund HRA 12812</pre></pre>
</div>
<br>
<p class="gmail-m_6646883934659480719airmail_on">Am 8. Mai 2019 um 16:29:29, Esteban Maringolo (<a href="mailto:emaringolo@gmail.com" target="_blank">emaringolo@gmail.com</a>) schrieb:</p>
<blockquote type="cite" class="gmail-m_6646883934659480719clean_bq"><span>
<div>
<div></div>
<div>

<div dir="ltr">I found that SiouX is effectively uploading the contents to an attachment file directory.
<div><br>
</div>
<div>Maybe there is a way to avoid instantiating a WAFile and use a WAExternalFile poiting to the file on disk, or simply using my custom SeasideResponder subclass.</div>
<div><br>
</div>
<div>This won't save VW from reading the whole file into memory before saving it to disk (or will it?) but it certainly will only keep the reference during the request/response of SiouX, which will be garbage collected faster than anything on a Seaside Component.<br>
</div>
<div><br>
</div>
<div>Regards,</div>
<div><br clear="all">
<div>
<div dir="ltr" class="gmail-m_6646883934659480719gmail_signature">Esteban A. Maringolo</div>
</div>
<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, May 8, 2019 at 10:10 AM Esteban Maringolo <<a href="mailto:emaringolo@gmail.com" target="_blank">emaringolo@gmail.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>Hi Felix,</div>
<div><br>
</div>
<div>That is similar to what Johan proposes in his article, but the goal is to achieve the same thing by using SiouX (VW's latest HTTP server) responders, maybe using a chunked read/write approach (so there is no more than a certain buffer in the object memory).</div>
<div><br>
</div>
<div>Regards,</div>
<br clear="all">
<div>
<div dir="ltr" class="gmail-m_6646883934659480719gmail-m_2112606625983693036gmail_signature">Esteban A. Maringolo</div>
</div>
<br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, May 8, 2019 at 9:46 AM Félix Madrid <<a href="mailto:fmadrid@gmail.com" target="_blank">fmadrid@gmail.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Hi Esteban,</div>
<div><br>
</div>
<div>Maybe this article (and project) from Nick Ager can help you:<br>
</div>
<div><br>
</div>
<div><a href="http://nickager.com/blog/2011/07/01/File-upload-using-Nginx-and-Seaside" target="_blank">http://nickager.com/blog/2011/07/01/File-upload-using-Nginx-and-Seaside</a></div>
<div><br>
</div>
<div>Cheers,</div>
<div><br>
</div>
<div>Félix<br>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, May 8, 2019 at 2:39 PM Esteban Maringolo <<a href="mailto:emaringolo@gmail.com" target="_blank">emaringolo@gmail.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div dir="ltr">
<div>I'm trying to use the SiouX responder fortification to limit a large file upload from blocking the whole image and/or filling its memory.</div>
<div><br>
</div>
<div>Looking at the options I found there is a "save attachments as files", which seems like a similar approach as the one proposed at <<a href="https://jbrichau.github.io/blog/large-file-upload-in-seaside" target="_blank">https://jbrichau.github.io/blog/large-file-upload-in-seaside</a> >
 using NGINX or Apache, but apparently that option only works at NetHttpResponder, but it's not applied in Seaside.<br>
</div>
<div><br>
</div>
<div>Did anybody integrate this feature or a similar one with Seaside in VW? (otherwise I'd have to do it myself).</div>
<div><br>
</div>
<div>Regards!</div>
<br clear="all">
<div>
<div dir="ltr" class="gmail-m_6646883934659480719gmail-m_2112606625983693036gmail-m_1395451669207518862gmail-m_5008885313183339203gmail_signature">
Esteban A. Maringolo</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
</blockquote>
</div>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div>
</div>
</span></blockquote>
</div>

</blockquote></div>