| Object: | SoftArtisans.FileUp |
| Syntax: | FormEx (["formelementname"]) |
| Type: | String or file object, depending on file contents |
| Read/Write: | Read/Write |
| Description: | This retrieves the value of the specified form element.
It returns form values in the same format as the ASP Request.Form object
including sub-collections for multi-select items. Prior to V2.2 of FormEx has been added in addition to the existing If the form element is a file, it will return the location of the file on the server (see the ServerName property). There is still one major difference between the FileUp FormEx object and the ASP Request.Form. It is possible to retrieve the raw unparsed form by specifying Request.Form without any parameters. This is acceptable when the form is small, such as less than 100 KB. However, in the case of file uploads, the potential size of the data is very large. By design, SA-FileUp Version 3.0- allows uploads into memory. See the UseMemory Property. If you require access to the unparsed data, it is possible to use the SaveBinaryAs method and then read back appropriate sections using |
<%
'---
'--- To iterate through the collection of all multiselect form elements
'---
For Each multiPart in upl.FormEx
'-- When using FormEx, everything is a collection
Response.Write("<BR><BR>Field: " & multipart )
'--- This is the standard ASP way: use .Count
For i = 1 to upl.FormEx(multipart).Count
Selection = upl.FormEx(multipart)(i)
Response.write("<BR>Using .Count ")
Response.write( i & ": " & selection )
next
'--- For symmetry, we also support iterating over the sub-collection
i = 1
For Each Selection in upl.FormEx(multipart)
Response.Write("<BR>Using subcollection ")
Response.Write( i & ": " & Selection )
i = i + 1
Next
'--- Iterate through collection and see if there
'--- is a File object in it.
i = 1
For Each element in upl.FormEx(multipart)
'--- If the element is an object then
'--- it is an SAFile object
If IsObject( element ) Then
If element.IsEmpty Then
Response.Write("<BR><BR>File " & element.Name & " is empty.")
Else
element.SaveAs("Filetest" & i & ".tst")
Response.Write("<BR><BR>File " & element.Name & " saved.")
End If
End If
i = i + 1
Next
Next
| Previous Page | Next Page |