w3Upload Reference

Reference w3Upload

 w3.upload
    Form : w3.FieldCollection
    GetData() : String
    SendADODBField( ADODBField ) : 
    SendFile( bstrFileName, [bSetContentType] ) : 


Properties

  Form : w3.FieldCollection
(v1.0)
Replacement Form object. Use this as the normal form object. See also the 'Getting Started' chapter.

There are several uses as this enables access to the field collection of the submitted form. Perhaps is the creation of references to indivdual field objects of the collection the most common usage. You can either reference the field by it's name or by using a numeric index.
See the reference of your chosen development envirnoment on handling of collections for further information.
// creating a variable reference to an individual field object in the field collection 
// of the submitted form:

var aName = upLoad.Form( 'chosenFileName' );
var uploadedFile = upLoad.Form( 'theFile' );

// you can type-cast the variables if you wish, for readability reasons, although it is usually an
// unecessary encapsulation of the object
// thus, alternatively, you could write:

var aName = new String ( upLoad.Form( 'chosenFileName' ) );

Methods

  GetData()  : String
(v1.0)
Returns ALL mimedata as a string.

  SendADODBField(ADODBField)
(v1.0)
Sends an ADODB stored file to the client

Note: Not fully implemented yet

  SendFile(bstrFileName, [bSetContentType])
(v1.0)
Sends a local file on the server to the client.

The method takes two arguments - path of the file to be sent and a content type. Instead of explicitly setting the content type you can set the second parameter to 'true' and leave it up to upLoad, which is probably the best way to do it.

Please see the 'Getting Started' chapter for usage information.
upLoad.SendFile( 'D:\\upload\\test.jpg', true );

// will send the specified file on the server to the client (browser), 
// where it will most likely be displayed