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

Philippe Marschall philippe.marschall at gmail.com
Tue Jul 29 18:25:45 UTC 2008


2008/7/29 Philippe Marschall <philippe.marschall at gmail.com>:
> 2008/7/29 Janko Mivšek <janko.mivsek at eranova.si>:
>> Philippe Marschall wrote:
>>
>>>> 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.
>>>
>>> Nope sorry, the example code was written explicitly to illustrate the
>>> problem. Upload streaming with Swazoo works only iff you know
>>> beforehand which fields will be files. There is now way how I can know
>>> this. Compare this to the upload streaming of Kom which detects which
>>> fields are files.
>>
>> 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?
>>
>> Bigger problem is that you don't have that knowledge until request come
>> quite deeply in the web framework and here the idea of "deferred" request
>> parsing, until information of input field names is known.
>>
>>> And even then the Swazoo code still breaks in MultiByteFileStream.
>>
>> I'm otherwise using Sport's Filenane and there is no signs of any broken
>> code or corruption of uploaded files.
>
> I use the posted code which uses Sport's Filename
>
> 29 July 2008 8:18:43 pm
>
> VM: Mac OS - a SmalltalkImage
> Image: Squeak3.9.1 [latest update: #7075]
>
> SecurityManager state:
> Restricted: false
> FileAccess: true
> SocketAccess: true
>
> ByteString(Object)>>error:
>        Receiver: ''
>

I attached the stack trace. I didn't seem to be send correctly.

Cheers
Philippe
-------------- next part --------------
29 July 2008 8:18:43 pm

VM: Mac OS - a SmalltalkImage
Image: Squeak3.9.1 [latest update: #7075]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true

ByteString(Object)>>error:
	Receiver: '' ''
	Arguments and temporary variables: 
		aString: 	''Improper store into indexable object''
	Receiver''s instance variables: 
'' ''

ByteString(Object)>>errorImproperStore
	Receiver: '' ''
	Arguments and temporary variables: 

	Receiver''s instance variables: 
'' ''

ByteString>>at:put:
	Receiver: '' ''
	Arguments and temporary variables: 
		index: 	1
		aCharacter: 	60
	Receiver''s instance variables: 
'' ''

MultiByteFileStream(StandardFileStream)>>nextPut:
	Receiver: MultiByteFileStream: ''/Users/marschall/apps/Smalltalk/Squeak/edit.esp.txt''
	Arguments and temporary variables: 
		char: 	60
	Receiver''s instance variables: 



--- The full stack ---
ByteString(Object)>>error:
ByteString(Object)>>errorImproperStore
ByteString>>at:put:
MultiByteFileStream(StandardFileStream)>>nextPut:
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MultiByteFileStream>>nextPut:
SpFileStream>>nextPut:
HTTPPost>>nextPut:to:afterTwoTo:
HTTPPost>>readEntityFrom:datum:boundary:
HTTPPost>>partFromStream:boundary:
HTTPPost>>multipartDataFrom:
HTTPPost>>parsePostDataFrom:
HTTPPost>>ensureFullRead
STStreamSite>>doPost:
STStreamSite>>answerTo:
STStreamSite>>helpResolve:
URIResolution>>visitResource:
[] in URIResolution>>visitChildrenOf:advancing: {[:each |  response := self visitResource: each.  response isNil   ifFalse: [...]}
OrderedCollection>>do:
URIResolution>>visitChildrenOf:advancing:
URIResolution>>resolveTransparentComposite:
URIResolution>>resolveServerRoot:
ServerRootComposite>>helpResolve:
URIResolution>>visitResource:
URIResolution class>>resolveRequest:startingAt:
HTTPServer>>answerTo:
HTTPConnection>>produceResponseFor:
HTTPConnection>>getAndDispatchMessages
[] in HTTPConnection>>interact {[[true]   whileTrue: [self getAndDispatchMessages.    Processor yield].  nil]}
BlockContext>>on:do:
SpExceptionContext class>>for:on:do:
[] in HTTPConnection>>interact {[SpExceptionContext   for: [[true]     whileTrue: [self getAndDispatchMessag...]}
[] in BlockContext>>newProcess {[self value.  Processor terminateActive]}


More information about the seaside mailing list