Click to See Complete Forum and Search --> : type=file multipart/form-data


lmf232s
12-13-2004, 06:21 PM
hey i need to allow a user to browse to a file and select it.
So i am using multipart/form-data with a type=file to achieve this.
everyting works except, i can not figure out how to get the full
name of the file.
It is displayed in the textbox like this
G:\Ac200\200011SHT01.dwg

but when i read it out i can get these parts.
ac200 or
200011SHT01 or
dwg
but i can not get
the drive G:\

I would like to grab the whole name if possible.

How do i do this. I have this code.


For Each File In Form.Files.Items
If Len(File.FileName) > 0 Then
Response.Write File.Name & " " & File.FileName & " " & File.Length & File & "<BR>"
End If
Next

russell
12-13-2004, 07:14 PM
You want the remote users directory structure?

lmf232s
12-17-2004, 02:59 PM
i fixed this but i never posted what i did.

Basically i just removed multipart/form-data
from the form.

I still used type=file.
but because i removed multipart/form-data i was able to
use request.form so i could just do
request.form("file1") and get the file path name instead of
doing something like
file.name, file.file etc.

This allowed me to still browse for the files and still interact
with the input field as a normal text box.

Bullschmidt
12-31-2004, 01:18 AM
And here is a pure ASP (i.e. no components) resource for letting the user upload a file (and get the name of the file) which is something that was unfortunately not built into ASP:

ASP File Upload Using VBScript by John R. Lewis - 7/10/2000
http://aspzone.com/articles/160.aspx