Newbie ASP Question.
I hope this is the right place to ask.
I have an ASP Upload element that I need help with.
This is the problem
I have 2 fields Image and FileName (FileName isnt the name of Image in this
case)
From page 1 I sudmit the 2 fields of info to the Upload Page.
The info arrives ok at the upload page.
I browse and select the file and hit submit...
The info for the Image arrives at destination but the FileName field does
not.
Heres the code I have...
<%
Dim MyFile
MyFile = Request("Name")
if UCase(Request.S erverVariables( "HTTP_METHOD")) ="POST" Then
Set fu = Server.CreateOb ject("AspUtil.F ileUpload")
fu.directory = Server.MapPath( ".")
rc = fu.Upload
If rc = 0 then
For n=0 to fu.count-1
set item = fu.item(n)
Response.Write "FileName: " & item.filename & "<BR>"
Response.Write "Bytes written: " & item.Size & "<BR>"
item.Save
Next
Else
Response.Write "File upload failed. RC: " & rc & "<BR>"
End If
response.redire ct "http://dmsproxy/adm/products/add_image.asp?N ewImage=" &
item.filename & "&FileName= " & MyFile
Else
%>
<form method=post ENCTYPE="multip art/form-data" action="upload_ image.asp">
<font size="2"> Image</font><input type=file name=Image size="20"
value="<%=Reque st("Image")%>"> <br>
Name<inpu t type="text" name="Name" size="20"
value="<%=Reque st("Name")%>">< br>
<br>
<input type=submit></form>
<%
end If
%>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003
I hope this is the right place to ask.
I have an ASP Upload element that I need help with.
This is the problem
I have 2 fields Image and FileName (FileName isnt the name of Image in this
case)
From page 1 I sudmit the 2 fields of info to the Upload Page.
The info arrives ok at the upload page.
I browse and select the file and hit submit...
The info for the Image arrives at destination but the FileName field does
not.
Heres the code I have...
<%
Dim MyFile
MyFile = Request("Name")
if UCase(Request.S erverVariables( "HTTP_METHOD")) ="POST" Then
Set fu = Server.CreateOb ject("AspUtil.F ileUpload")
fu.directory = Server.MapPath( ".")
rc = fu.Upload
If rc = 0 then
For n=0 to fu.count-1
set item = fu.item(n)
Response.Write "FileName: " & item.filename & "<BR>"
Response.Write "Bytes written: " & item.Size & "<BR>"
item.Save
Next
Else
Response.Write "File upload failed. RC: " & rc & "<BR>"
End If
response.redire ct "http://dmsproxy/adm/products/add_image.asp?N ewImage=" &
item.filename & "&FileName= " & MyFile
Else
%>
<form method=post ENCTYPE="multip art/form-data" action="upload_ image.asp">
<font size="2"> Image</font><input type=file name=Image size="20"
value="<%=Reque st("Image")%>"> <br>
Name<inpu t type="text" name="Name" size="20"
value="<%=Reque st("Name")%>">< br>
<br>
<input type=submit></form>
<%
end If
%>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003
Comment