|
We create an XForm object. To start with we want to report the
color that our visitor chose. We simply reference our XForm object,
passing in the name of the field we want.
Next we want to write out the flavors chosen. Because all the
checkboxes have the same name we have to loop through all the
fields named "flavor" getting the value of each and writing it
out.
Finally we deal with the file upload. If a file was uploaded we
save it into a directory called "images" (the virtual path is
relative to the location of the current page). We use the FileName
property to give it a URL safe name, identical or similar to the
original name of the file.
<% @Language="VBScript" %>
<html>
<body>
<%
Set theForm = Server.CreateObject("ABCUpload4.XForm")
Response.Write "Your favorite color is "
Response.Write theForm("color") & "<br>"
Response.Write "You like these types of ice cream<br>"
For i = 1 to theForm("flavor").Count
Response.Write theForm("flavor")(i) &
"<br>"
Next
Set theField = theForm.Files("file")
If theField.FileExists Then
theField.Save "images/" & theField.FileName
Response.Write "File " & theField.FileName & "
uploaded"
Else
Response.Write "No file uploaded"
End If
%>
</body>
</html>
|