[Seaside] File Upload

Avi Bryant avi at beta4.com
Tue Feb 18 19:47:23 CET 2003


On Tue, 18 Feb 2003, Avi Bryant wrote:

>
> On Tue, 18 Feb 2003, Glenn Swanlund wrote:
>
> > Is there a way in Seaside to upload a file?
>
> Ok, file in the attached changeset and you should be good to go.

It might help if I actually attached the changeset.
-------------- next part --------------
!WAHtmlRenderer methodsFor: 'core' stamp: 'ab 2/18/2003 19:39'!
fileUploadWithCallback: aBlock
	self inputWithType: 'file' named: (callbacks registerCallback: aBlock)
! !

WAComponent subclass: #WAUpload
	instanceVariableNames: 'file '
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Seaside/Examples-Basic'!

!WAUpload methodsFor: 'as yet unclassified' stamp: 'ab 2/18/2003 19:38'!
renderContentOn: html
	html heading: 'Upload File'.
	
	html attributeAt: 'enctype' put: 'multipart/form-data'.
	html form: [
		html fileUploadWithCallback: [:f | file _ f].
		html submitButton.
	].

	file ifNotNil:
		[html bold: [html text: file fileName].
		html preformatted: file contents contents].! !

!WAUpload class methodsFor: 'as yet unclassified' stamp: 'ab 2/18/2003 19:36'!
initialize
	self registerAsApplication: 'upload'! !

WAUpload initialize!


More information about the Seaside mailing list