Documentation Archive Developer
Search
PATH Documentation > WebObjects

Table of Contents

WOFileUpload



Element Description

A WOFileUpload element displays a form element in which a client browser can specify a file to be uploaded to the server. It corresponds to the HTML: <INPUT type=file>.

WOFileUpload elements inside of a WOForm require that the WOForm have the attribute's encoding type set as follows:

enctype = "multipart/form-data"

For further information on the file upload specification, see RFC1867: http://www.w3.org/RT/REC-html32.html#rfc1867.

If you want to process a file upload in a direct action, use WORequest's formValueForKey: method to get the contents of the file that has been uploaded. This method is declared as follows:

- (id)formValueForKey:(NSString *)aKey

or, in Java,

public java.lang.Object formValueForKey(java.lang.String aKey)

Synopsis

WOFileUpload { filePath=aPath; data=fileData };

Bindings

filePath
The full file path and name of the file uploaded is sent by the browser and returned as a string to the variable or method bound to this attribute.
data
The file that is uploaded will be returned as an NSData object to the variable or method bound to this attribute.

Table of Contents