[Seaside] WAImage implemented but a question and suggestion follows

Dmitry Dorofeev dima-sender-3c337a at yasp.com
Tue Mar 29 22:44:31 CEST 2005


Hi All !

Thanks to Michel Bany i have now WAImage working for me!
How i get it including into Seaside/Squeak distribution though ?

I see some strange thing in the code like this:
------------------
renderContentOn: html
| errorText |
html fileUploadWithCallback:
	[:f |
		[image := f asImage. errorText := nil]
		on: NotAnImage do:
		[:e | image := nil. errorText _ 'This is not a supported image, ', f 
contentType.]
	].
Transcript show: errorText.
---------------------
If I upload non-image file I never see errorText value printed in 
Transcript because errorText is nil.
Checked in debugger and i see that assignment was made in the block. 
But somehow value is visible only in the
  block and not in method body. If I make errorText an instance var, 
then everything is working as expected.
Is it Seaside specific, Smalltalk specific, Squeak (3.7) specific or i 
just missed something ?

Another question is how do I throw an exception in Squeak?
IS it ok to write:

NotAnImage new signal: 'Image file format unrecognized'.


The suggestion is to limit amount of data which is possible to POST 
into Seaside.
I know that Internet is not safe place and bad boys may easily achieve 
denial of service
by POSTing big files into Seaside. At least such limit exist in Perl 
CGI module.
May be the amount of data allowed to be POSTed should be configurable 
in App Config page per application ?
Default on 500Kb sounds reasonable for me.

Thanks,

-Dmitry.


More information about the Seaside mailing list