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




hi kevin,

well, its the other way around. i am using an HTTP Web application to
upload files to an FTP server. i am new to this so, corrections
welcome.
the user is on the Web server where he accesses the upload page.
he uses the form outlined in the Stickman link to upload multiple
files. .
once he hits "upload" on the upload page, the script is called that
logs
onto the FTP server and sends the file from the user's computer to the
FTP server (via the Web server).

i was thinking that this will cause havoc on the http traffic and that
the best
way to do it is to redirect the users to the FTP server (for the
presentation layer)
so the whole upload process is handled by the FTP server. is this the
way to go?

So:

1. User Logs On To Web Server (ASP.NET Pages)
2. User Accesses Upload Form On Web Server
3. User Uses Hiddend Inputs To Upload Multiple Files
4. User Hits Upoload_Click On Same Form
5. Upload_Click runs VB.NET script that calls clsFTP
6. clsFTP is a script that logs onto the FTP server (a different
computer) and,
if all goes well, sends the file(s).

here is a link to clsFTP:
http://www.dotnethero.com/hero/vbnet/ftp.aspx?nmx=8_4

thanks again,
peter

Kevin Spencer wrote:
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...


.



Relevant Pages

  • Re: tried everything- cannot publish to web
    ... the path to the FTP server correctly, ... firewall, and/or a third party firewall included in a antivirus suite, or a ... looking at the instructions from Yahoo about how to upload your site, ... how to use their control panel to upload your files. ...
    (microsoft.public.publisher.webdesign)
  • Re: connect to FTP server
    ... That's why I suggested that you *do* specify it. ... asp.net faq: http://asp.net.do/faq/ ... I'd *never* upload files to that directory. ... I'm logged into the FTP server to see if my file is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: IIS 6 FTP problem
    ... Why there is port 20, if my FTP server runs on default port 21? ... > and I assumed you got the 'succesful upload' msgs when uploading at local ... > Bernard Cheah ...
    (microsoft.public.inetserver.iis.ftp)
  • Re: Binary To ASCII?
    ... be causing the difference when the file lands on the FTP server? ... by the way) prior to upload. ... I am indeed sending in Binary mode. ... I am wondering if anybody here is familiar with Microsoft's clsFTP ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Help : FTP A PDS
    ... since the one reason I can think of to download a mainframe load ... the user might want to upload a load module to testcase.boulder.ibm.com ... done) in the FTP server and/or client. ... Search the archives at http://bama.ua.edu/archives/ibm-main.html ...
    (bit.listserv.ibm-main)