Store Temporary Vale Help

T

Tim James

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.ServerVariables("HTTP_METHOD"))="POST" Then
Set fu = Server.CreateObject("AspUtil.FileUpload")
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.redirect "http://dmsproxy/adm/products/add_image.asp?NewImage=" &
item.filename & "&FileName=" & MyFile
Else
%>
<form method=post ENCTYPE="multipart/form-data" action="upload_image.asp">
<font size="2">&nbsp; Image</font><input type=file name=Image size="20"
value="<%=Request("Image")%>"><br>
&nbsp;Name<input type="text" name="Name" size="20"
value="<%=Request("Name")%>"><br>
<br>
<input type=submit></form>
<%
end If
%>
 
R

Ray at

You' have to use the upload component to retrieve form field values. I
don't know that component, but it my something along the lines of:

sTheTextInput = fu.form.item("Name")

Look at the documentation for the component for how to retrieve normal form
field values.

Ray at work
 
T

Tim James

Thanks for the speedy reply Ray.
This is an old component that I have zipped up and I dont even know the
author. I has no documentation with it.
I will have to google it and see what I can find out...
Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,141
Messages
2,570,814
Members
47,358
Latest member
AlexSon

Latest Threads

Top