Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FTP Upload multiple files without disconnect using .NET

Tags:

.net

ftp

I'm uploading multiple files using FtpWebRequest.
But for every file I'm opening and closing a connection.

How can I upload multiple files using the same connection?

Like a ftp client application, connect using username and password, change directory, upload file1, upload file2, upload file3, disconnect.

like image 408
InfoStatus Avatar asked Nov 20 '09 19:11

InfoStatus


People also ask

How do I upload multiple files to FTP?

To transfer files to another computer, open an FTP connection to that computer. To move files from the current directory of your computer, use the mput command. The asterisk ( * ) is a wildcard that tells FTP to match all files starting with my . You can also use a question mark ( ? ) to match a single letter.

How do I upload files to an FTP automatically?

Setting up automatic FTP scheduling is as easy as right-clicking on the folder or directory you want to schedule, and clicking Schedule. In the Task Scheduler section you'll be able to name the task, and set a date and time for the transfer to occur.

Why FTP is discontinued?

FTP has long been used to exchange files between computers on a network, but it's burdened by enough security issues that browser makers are dropping support for the protocol because the exchange happens without encrypting data in transit between two points.


1 Answers

The default value of FtpWebRequest.KeepAlive is true. Are you explicitly setting KeepAlive to false?

like image 179
MArag Avatar answered Sep 30 '22 20:09

MArag