8

How can I upload files to server with ftp though code? my web host apperently dont allow ous to use the "regular" fileupload with in MVC or Web forms anymore on IIS7

I rather not use a third part app I use asp.net mvc 2, c#

3 Answers 3

17

There are various methods but the simplist in my opinion is to make use of the FtpWebRequest class. There is a nice example of a simple file upload, making use of it, here:

http://msdn.microsoft.com/en-us/library/ms229715.aspx

0
2

I use Rebex FTP for .NET - not free but a great little FTP library. It allows you to upload using a Stream so might meet your requirements.

http://www.rebex.net/ftp.net/

1
  • Thanks for the reply but my client dont want to pay for extra components at this point.
    – Dejan.S
    Apr 30, 2011 at 13:29
2

WCF, maybe, is a choise.

This thread may be help you, Copy Files to FTP Server using WCF.

Some weeks ago, I just develop a project with WCF. I feel it is powerful and productivity.

2
  • your link is broken. it is missing semicolon after http :S
    – tugberk
    Apr 30, 2011 at 17:56
  • Sorry for the broken link. It is fixed. Thanks @tugberk
    – Lu Ming
    May 5, 2011 at 14:19

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.