Re: probls with file upload script... pls help



Forgive me if I'm misunderstanding you, but it sounds like you're using an
FTP client to upload a file to an HTTP web application. Can you be more
specific about the Work Flow of your app? Apparently, you have an ASP.Net
page that has a file upload element in it, and the file begins by uploading
a file via HTTP (your ASP.Net page) to your web server. What happens after
that? How is the uploaded file handled by your web application? Is your web
application attempting to transfer it to an FTP server, or what?

--
HTH,

Kevin Spencer
Microsoft MVP
Logostician
http://unclechutney.blogspot.com

There is a madness to my method.

"pbd22" <dushkin@xxxxxxxxx> wrote in message
news:1165695219.584239.45990@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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...



.