I have a form that passes variables to an asp file and then uploads a file.
For some reason the request.form is not getting the info from the form.
It's returning blanks. Any insight would be appreciated....
Here is the asp file
<HTML>
<HEAD>
<TITLE>File Upload Results</TITLE>
<BODY>
<font color=#000000>< b>Files Uploaded Status:</b></font><br><br>
<%
Set Upload = server.createOb ject("Chili.Upl oad.1")
Upload.AllowOve rwrite = True ' Generate unique names
'Upload.SizeLim it = 150000 ' Truncate files above 50KB
On Error Resume Next
MyArray = Split(Upload.So urceFileName, "\")
FName = MyArray(UBound( MyArray))
If Upload.SourceFi leExtension = ".pdf" or Upload.SourceFi leExtension =
".zip" Then
If Upload.FileSize < 3000000 Then
UpldAllowed=Tru e
Else
UpldAllowed=Fal se
End If
Else
UpldAllowed=Fal se
End If
If Upload.SourceFi leExtension = ".gif" or Upload.SourceFi leExtension or
".jpg" or Upload.SourceFi leExtension or ".png" Then
If Upload.FileSize < 150000 Then
UpldAllowed=Tru e
Else
UpldAllowed=Fal se
End If
Else
UpldAllowed=Fal se
End If
If UpldAllowed=Fal se Then
Response.Write "<font color=red><b>Yo ur file is either of an disallowed
type or is too large. Please <a href=upload.asp >try
again</a></b></font><br>"
Else
Upload.SaveToFi le(Server.mapPa th("/") & "/" & "/iparttest/upload/" & FName)
Response.Write "<font color=#000000>< b>File: </b></font>" &
Upload.SourceFi leName & " <font color=#009900>< b>--Size:" & Upload.FileSize
&" Bytes -- </b></font> <a target=_blank
href=http://www.sdotson.com/iparttest/upload/" & FName & ">Click to
Test</a><br>"
Response.Write "<br>Copy and paste the following to use your image/file in
the forum:<br><br>"
If Upload.SourceFi leExtension = ".pdf" or Upload.SourceFi leExtension =
".zip" then
Response.Write "<b><font
color=red>http://www.sdotson.com/iparttest/upload/" & FName & "</b></font>"
Else
Response.Write "<b><font
color=red>[img]http://www.sdotson.com/iparttest/upload/" & FName &
"[/img]</b></font>"
End If
End If
Upload.Close
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Open
"driver={MySQL} ;server=localho st;database=use rname","usernam e","password "
response.write "stuff"
response.write "Descriptio n="
response.write (request.form(" description"))
set the variables
strImageURL = ""
strFilename = FName
strDescription = request.form("d escription")
strAuthor = request.form("a uthor")
strCategory = request.form("c ategory")
strIsVerified = "False"
strUpdateDate = Date
sql = "INSERT INTO iparts
(imageurl,filen ame,description ,author,categor y,isverified,up datedate) VALUES
('" & strImageURL & "','" & strFilename & "','" & strDescription & "','" &
strAuthor & "','" & strCategory & "','" & strIsVerified & "','" &
strUpdateDate & "')"
Conn.Execute(sq l)
Conn.Close
%>
</BODY>
</HTML>
_______________ _______________ _______________
and here is the form:
<html>
<FORM METHOD="POST" ENCTYPE="multip art/form-data" ACTION="addnewi part.asp">
<table border="0">
<tr>
<td>iPart to Upload:</td>
<td><INPUT TYPE="FILE" NAME="FILE1"></td>
</tr>
<tr>
<td>Your Name:</td>
<td><input type="text" name="author" size="50"></td>
</tr>
<tr>
<td>Description :</td>
<td><input type="text" name="descripti on" size="50"></td>
</tr>
<tr>
<td>Select a Category - <a href="categoryh elp.html">Help</a></td>
<td> <SELECT NAME="category" >
<OPTION value="hydrauli cs">Hydraulic s
<OPTION value="pneumati cs">Pneumatic s
<OPTION value="fastener s">Fasteners
<OPTION value="hardware ">Hardware
<OPTION value="powertra nsmission">Powe r Transmission
<OPTION value="fastener s">Fasteners
<OPTION value="fastener s">Fasteners
</SELECT>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="Upload iPart"></td>
</tr>
</table>
</form>
</html>
--
Sean Dotson, PE
Autodesk Inventor Certified Expert
http://www.sdotson.com
http://www.sdotson.com/forums/
Check the Inventor FAQ for most common questions
www.sdotson.com/faq.html
-----------------------------------------------------------------------