Question FTP using FTPwebrequest class via web server

sugants

New member
Joined
Aug 18, 2008
Messages
4
Programming Experience
1-3
Hi,

I have created a FTP component in VS2008 using ftpwebrequest class.

The problem is the file is getting uploaded to the ftp server when I’m running the code from my local.

But when I run the code from my web server and try to upload a file from my local system to the ftp server, it is not working.

Its looking for the file in the web server.

Eg: if I upload a file from my local path : C:/testftp.doc

It is looking in the web server c:/. I am not sure how to pass the client path.

Can u pls help me in this regard.
 
ASP.Net is server applications running at server, clients interacts by making http requests to them and get responses. This is a disconnected architecture, the server can not connect to the client, only process what the client provides by the various requests. For a web application to upload a client file to FTP the client must first upload the file to the server, then server can pass it to FTP. Do this with FileUpload control.
 
Hi
I want to upload multiple files on the server using a single fileupload control. Once I browse i'll attach it to a list box and then go for a second file, if i am done with file selection, i'll upload all the files in one shot. I also want to know abt the ftpwebrequest class. Is it useful in someway to my problem?
 
You need one FileUpload control for each file user wish to upload, then a single submit button can be used to catch all files in Request.Files, see for example Uploading Multiple Files from the Same Page.

FtpWebRequest can be used to upload file to Ftp, so can WebClient class.
 
Back
Top