This class is the most crucial of all because it contains all the information regarding the uploaded files. It also works equivalent to ASP's Request.Form in a way that it can bring the value of the specified field in almost similar fashion. Its instance is created by the upper classes ( FileUp and SAFile ). It cannot be instantiated independently.
It offers the following properties:
This method brings the value of the field whose name is specified in either the argument i.e.'fieldname' of this method or in the ' form' method.
Example:
( getting the values of the Form
fields)
Html page:
<HTML><HEAD>
<TITLE>Getting values of fields </TITLE>
</HEAD>
<BODY>
<FORM enctype="multipart/form-data" method="post" action="sample2.asp">
<SELECT NAME="CHIOICE" >
<OPTION>Image
<OPTION>Text
<OPTION>Source Code
<OPTION>Archive
</SELECT>
<BR>
<INPUT TYPE=TEXT NAME="DESCRIPTION"><BR>
<INPUT TYPE=FILE NAME="FILE1">
<BR>
<INPUT TYPE="submit">
</FORM>
</BODY>
</HTML>
Script for 'sample2.asp':
<%
Set obj = Server.CreateObject("SoftArtisans.FileUp")
choice=obj.form("CHOICE").Item
des=obj.form("DESCRIPTION").Item ' and not obj.form("DESCRIPTION")
file=obj.form.Item("FILE1") 'another way of calling
Response.Write choice
Response.Write des
Response.Write file
%>
It is important to note that the values cannot be accessed simply by writing obj.form("fieldname"), rather the method of 'Item' has to be called on the 'form' method.
This is a Read-Only property. Count is the no. of fields present on the Form.
Example:
(getting Count)
Html page:
<HTML><HEAD>
<TITLE>Getting values of fields </TITLE>
</HEAD>
<BODY>
<FORM enctype="multipart/form-data" method="post" action="sample2.asp">
<SELECT NAME="CHIOICE" >
<OPTION>Image
<OPTION>Text
<OPTION>Source Code
<OPTION>Archive
</SELECT>
<BR>
<INPUT TYPE=TEXT NAME="DESCRIPTION"><BR>
<INPUT TYPE=FILE NAME="FILE1"><BR>
<INPUT TYPE="submit">
</FORM>
</BODY>
</HTML>
Script for 'sample2.asp':
<%
Set obj = Server.CreateObject("SoftArtisans.FileUp")
count = obj.Count
Response.Write count 'returns 4 in this case.
%>
Back
to UploadDictionary Back
to Properties Back
to iASP_FileUp