开发者

Upload and rename multiple files to FTP using asp.net

We are creating CMS, in which we want to have the option to upload multiple files to FTP server. The 开发者_开发技巧steps are

  1. Open FTP connection
  2. Click browse - Select multiple files - Click upload to FTP
  3. Create a folder on the FTP server
  4. Rename the selected files and upload them to the folder
  5. Close the connection

It will be good if it shows the status of the upload.

We are using asp.net with C#. Any sample code will help. Is there any good components available. I can spend max of $150 to buy a component.

Please help. Thanks in advance.


First of all, you should use an open source CMS and improve the code to your needs, don't try to reinvent the wheel!

Second, there is no need to spend money, plenty of solutions out there ...

you can use, for example Uploadify to pass user files to your server, then using any FTP Example upload the files to the FTP and delete them from the server upon success.

if you don't want to have the "middle men", just upload directly to the FTP

string name = Path.GetFileName(UploadControl.FileName);
byte[] data = UploadControl.FileBytes;

using (WebClient client = new WebClient()) {
   client.UploadData("ftp://my.ftp.server.com/myfolder/" + name, data);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜