[Seaside] How to make an upload page

Alain Fischer alain.fischer@bluewin.ch
Fri, 22 Mar 2002 17:46:24 +0100


Hello all,

Thanks to Avi for having done this quite impressive framework

I finally have found time to try Seaside and the first impression is 
quite good.
I have tried to develop a small application with Seaside and with 
WebObject.
The result is that just with the tutorial and some information from the 
mailing
list I was able to develop more rapidly with Seaside.

But now I am stopped since a few hours trying to make a page to upload a 
file
from a client  to the server without result. I know this must be 
possible because
this is doable with Swiki.

Here is my component:

IAComponent subclass: #TLAdministration
	instanceVariableNames: 'inputValue '
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Tilulu'

html

	^ '
	<a href="@home">Home</a>
	<hr>
	<h2>Administration</h2>
	<h3>Upload File</h3>
	inputValue: [inputValue]
	<form action="@test" enctype="multipart/form-data">
		<input type="text" name="@inputValue" size="80"><br>
		<input type="file" name="@filestuff" size="80"><br>
		<input type="submit" value="Send">
	</form>
	'
home

	self callPage: (TLInstrumentList new)

test

	^ self

filestuff

	self error

The text input work well but I don' know how to have access to the file 
name
in the input box nor I know how to have access to the data of the file.
I have tried to put the atribute name="@filestuff" but the method with 
the
corresponding name is never called. I think that I miss something
very basic but I don't figure out what.

With WebObject there is a WOFileUplod component with two binding: 
filePath and data
and this kind of operation is quite easy except that the filePath is 
dependent of the browser.

Any bits of information is welcome.
Alain.