[Seaside] [Q] File Upload/Download Server, Comanche or Swazoo

Janko Mivšek janko.mivsek at eranova.si
Tue Jul 29 12:18:36 UTC 2008

Philippe Marschall wrote:

>> I don't understand how there is no way to know which input fields will be
>> file ones. Web framework is naming them during HTML generation anyway, I
>> suppose Seaside too?
> Yes, in a non-predicable way (for the server adapter). Even if it
> would generate them in a predictable way there would still be a
> problem if you have multiple file upload fields in the same form.

In Aida there is completely predictable way to generate names and pair 
them with forthcoming POST. I therefore don't see the reason why Seaside 
can't do something similar.

See for example image upload in http://squeaksite.aidaweb.si/About/ 
(login as demo/demo, then edit that page and see Attach image IFRAME). 
If we look at source of this IFRAME, there we have the following input 

<form  method=post action="/About/?view=images&version=2"
   <input type="hidden" name="id5273" value="images">
   <input type="file" name="field3">
   <input type="submit" name="field4" value="Upload">

As you can see field names are auto generated and Aida register them 
internally so that fields can be paired with post data in forthcoming POST.

For streaming this pairing must not occur until you don't know the 
destination file, so you must not read post data from POST until then. 
This is maybe your problem, you read too fast post data in your adapter. 
End result in that case is that you stream the upload "in the air", 
because target stream is unknown.


Janko Mivšek
Smalltalk Web Application Server

More information about the seaside mailing list