probls with file upload script... pls help



hi.

i am having probs understanding how to grab a file being uploaded from
a remote client. i am using hidden input fields for upload such as:

<input id="my_file_element" type="file" name="file_1" size=46 /><input
type=submit />

so, after adding a few files, the input fields look like this:

<input name="file_3" type="file"><input style="position: absolute;
left: -1000px;" name="file_2" type="file"><input style="position:
absolute; left: -1000px;" name="file_1" type="file"><input
style="position: absolute; left: -1000px;" id="my_file_element"
name="file_0" size="46" type="file"><input type="submit">

I am using the microsoft-provided clsFTP class for uploading files to
my server. below is the code that calls the class and attempts to
upload the user-added files...

Dim ftpClient As New Code.clsFTP("192.168.10.10", "", "anonymous",
Context.User.Identity.Name, 20)

If (ftpClient.Login() = True) Then

'Create a new folder
ftpClient.CreateDirectory("FTPFOLDERNEW")

'Set our new folder as our active directory
ftpClient.ChangeDirectory("FTPFOLDERNEW")

'Set FTP mode
ftpClient.SetBinaryMode(True)

// TEST HERE WITH FILE_1 - ALWAYS FAILS
dim params as String = Request.Params.Get("file_1")

'Upload a file from your local hard disk to the FTP site.
ftpClient.UploadFile(Server.MapPath(params))

ftpClient.CloseConnection()

End If

OK. the problem is that when Request.Params.Get("file_1") is called, it
gets the string path
of the file. so, ftpClientUploadFile looks for that string in the local
directory, be it Server.MapPath or simply ftpClient.UploadFile(params).
Since this file is coming from the *user's computer* and not my Web
Server, how do i do this?

eagerly awaiting responses...

.



Relevant Pages