954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

C# Ftp multiple file uploads

Hi everyone, i'm working on a simple console application for my company, which would backup the company's X:\ drive by uploading its data every day at 3:00pm.

Questions:
1. Suggestions on how to upload a directory? (if not possible, then is it possible to automatically upload file by file)
2. An online alternative to ftp?

I really appreciate any help. Thank you

karimnouh
Newbie Poster
3 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

You will need to send the files one at a time.
using System.IO;
using System.Net;

Use the Directory.GetFiles() method to find the files you want to send.
Use a WebClient and the .UploadFile() method to send the files to the remote server.

There are other options for uploading, but this one will work in most cases.

thines01
Postaholic
Team Colleague
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: