Upload and server FTP

  • Thread starter Thread starter Fabrice
  • Start date Start date
F

Fabrice

I'm creating a website to allow user to upload file on my FTP server.
I need to get the filename, the extention and the local path of this one to
begin the upload process to my FTP server and not on my web server. What is
the best way to get these informations.
Can I use the upload control to have informations about he file and do a ftp
transer with FTPWebRequest ?
Or is there a best method ?

thanks
fabrice
 
I'm creating a website to allow user to upload file on my FTP server.
I need to get the filename, the extention and the local path of this one to
begin the upload process to my FTP server and not on my web server. What is
the best way to get these informations.
Can I use the upload control to have informations about he file and do a ftp
transer with FTPWebRequest ?
Or is there a best method ?

thanks
fabrice

A better method is the WebClient.UpLoadFile(filename, address)
The address (Url) can include the ftp:// prefix so it handles all the
ftp interaction automatically.

The file supplied by the user via the FileUpload control will only
have the filename in the request header (FileUpload.FileName property)
not the local path (on the client machine that is).
Use the FileUpload.SaveAs() method to save a local copy and then do
the upload to the ftp server from there.

HTH
 
Just so we're one the same page

1. User initiates upload via http page
2. file details are checked / verified
3. file is sent to ftp server

is this correct?

Chris
 
Back
Top