Re: [Seaside] Re: Re: [squeak-dev] [Q] File Upload/Download Server, Comanche or Swazoo

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

Re: [Seaside] Re: Re: [squeak-dev] [Q] File Upload/Download Server, Comanche or Swazoo

Janko Mivšek

Philippe Marschall wrote:

> 10 GB is massive. There are whole lot of 32bit integers that can
> overflow and a lot of other things that can go wrong at any stage
> including the browser and Apache.
>
>> My current idea is that I should create module(?) for Comanche or Swazoo for File
>> Upload (this just process multipart/form request for file upload with additional
>> parameters) and small web application or module for processing download url.(This
>> might be possible with Seaside with RESTable URL support or simple module).
>
> I only tried the upload streaming for Kom on localhost. While it could
> handle largish files (40 MB) it wasn't able to get close to 400 MB. So
> Kom might not be your tool. I have not seen an upload streaming API
> for Swazoo (which doesn't mean it's not there). Squeak might not be
> the best tool for the job where. HTTP might not be as well.

Swazoo 2.x has streaming upload and download capability and can easily
handle such big files. I tested with few GB by myself. On both Squeak
and VW.

Maybe it is a time to add that streaming to your Swazoo adaptor too? See
http://www.swazoo.org/streaming.html for more. See also HTTPRequestTest
with examples, how to use it (testing-posts).

Best regards
Janko


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: [Seaside] [Q] File Upload/Download Server, Comanche or Swazoo

Janko Mivšek
Philippe Marschall wrote:

>> See this example from http://www.swazoo.org/streaming.html:
>>
>> Site>>answerTo: aHTTPRequest
>>  | stream |
>>  aHTTPRequest
>>    postDataAt: 'file'
>>    beforeStreamingDo: [:datum |
>>      stream := (SpFilename named: datum filename) writeStream.
>>      datum writeStream: stream].
>>
>>  aHTTPRequest ensureFullRead. "to be sure streaming occurs"
>>  stream close.           "mandatory, to close open stream! "
>>
>>  ^HTTPResponse ok
>>
>>
>> In that example we open a file named as the original file, which  is sent in
>> request as post data, just before a file content.
>>
>> I hope that helps
>
> Nope sorry. See the attached code. Your example and the attachment
> work only if there is an upload filed with the name 'file'. That's the
> only upload filed that will be streamed. That's why the attached code
> breaks. If you change the name of the upload field to 'file' then the
> code breaks somewhere in MultiByteFileStream (Squeak 3.9 Mac VM).

Philippe, first sorry for late answer. Time pressures ...

I looked at your code, where you make a subclass of Site where is a test
form with file input field , then post via streaming to output file.

Problem is that you named file input field as "upload" while in my
example it is expected to be "file". So, just adjust those two names and
your example should work.

Best regards
Janko


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si