Uploader Object

Uploader object allows to upload files selected in the HTML-form on to the server. It is used only in ASP. All the HTML-form data are stored in corresponding Uploader object collections:

To initialize the collections with the HTML-form elements use ParseRequest method. It gets as a parameter the data sent to the server from the client as part of a POST request (generally, value returned by ASP's Request.BinaryRead method).

If you have problems with the representation of uploaded data (for example, '???' or 'aei' instead of international characters) or if you use <@ CODEPAGE> or Session.Codepage directives on your ASP page, consider Uploader.Codepage property.

Syntax

Uploader.property|method

 

Collections
FormElements The collection of the HTML-form elements
FormFiles The collection of the HTML-form files
Properties
Codepage Defines the codepage in which the request will be treated
Methods
ParseRequest Initializes Uploader object collections with HTML-form elements

 

Remarks

Use MailBee.Uploader object only in ASP applications.

 

Example

For proper work of this example you should create two separate files. In the first file implement ASP's commands intended for work with uploaded elements and files (the first piece of the example's code, "filename.asp"). In the second file HTML-form should be implemented (the second piece of the code, "filename.htm").

' "filename.asp"
<% Set Uploader = Server.CreateObject("MailBee.Uploader")
Uploader.ParseRequest Request.BinaryRead(Request.TotalBytes)
For Each File In Uploader.FormFiles
   File.SaveToDisk "C:\Temp"
Next %>

' "filename.htm"
<form action="filename.asp" method="post" enctype="multipart/form-data">
<input type=file name=file1>
<input type=file name=file2>
<select name="abc" multiple>
   <option selected>1
   <option selected>2
</select>
<select name="abc" multiple>
   <option selected>1
   <option selected>2
</select>
<input type=text name=x>
<input type=submit>
</form>

 

See Also

FormElements Collection | FormFiles Collection | FormElement Object | FormFile Object

 


Send feedback to AfterLogic
Copyright © 2002-2022, AfterLogic Corporation. All rights reserved.