Questions tagged [ftpwebrequest]

FtpWebRequest is a concrete class for .NET Framework applications that provides an FTP-specific implementation of the abstract WebRequest class. Related tag: [webrequest].

The FtpWebRequest class provides an FTP-specific implementation of the WebRequest class.
Implements a File Transfer Protocol (FTP) client.

MSDN documentation for FtpWebRequest.

612 questions
70
votes
5 answers

How to check if file exists on FTP before FtpWebRequest

I need to use FtpWebRequest to put a file in a FTP directory. Before the upload, I would first like to know if this file exists. What method or property should I use to check if this file exists?
Tom Smykowski
  • 25,487
  • 54
  • 159
  • 236
44
votes
8 answers

FtpWebRequest Download File

The following code is intended to retrieve a file via FTP. However, I'm getting an error with it. serverPath = "ftp://x.x.x.x/tmp/myfile.txt"; FtpWebRequest request = (FtpWebRequest)WebRequest.Create(serverPath); request.KeepAlive =…
Paul Michaels
  • 16,185
  • 43
  • 146
  • 269
35
votes
11 answers

How to check if an FTP directory exists

Looking for the best way to check for a given directory via FTP. Currently i have the following code: private bool FtpDirectoryExists(string directory, string username, string password) { try { var request =…
Billy Logan
  • 2,833
  • 16
  • 43
  • 49
34
votes
18 answers

How to improve the Performance of FtpWebRequest?

I have an application written in .NET 3.5 that uses FTP to upload/download files from a server. The app works fine but there are performance issues: It takes a lot of time to make connection to the FTP server. The FTP server is on a different…
A9S6
  • 6,575
  • 10
  • 50
  • 82
31
votes
15 answers

FtpWebRequest returns error 550 File unavailable

I have created a small windows forms application to upload the file to one of our client's ftp site. But the problem that I'm having is that when I run this application on my local machine it uploads the file successfully. But if I run this program…
chosenOne Thabs
  • 1,480
  • 3
  • 21
  • 39
30
votes
6 answers

Does .NET FtpWebRequest Support both Implicit (FTPS) and explicit (FTPES)?

I am being asked to support implicit and explicit FTPS (also known as FTPES). We are currently using the .NET FtpWebRequest. Does the FtpWebRequest support both types of FTPES, and what is the difference? Thanks
PortageMonkey
  • 2,675
  • 1
  • 27
  • 32
29
votes
7 answers

How to detect working internet connection in C#?

I have a C# code that basically uploads a file via FTP protocol (using FtpWebRequest). I'd like, however, to first determine whether there is a working internet connection before trying to upload the file (since, if there isn't there is no point in…
Detariael
  • 4,152
  • 4
  • 19
  • 10
28
votes
4 answers

How can we show progress bar for upload with FtpWebRequest

I am uploading files to ftp using FtpWebRequest. I need to show the status that how much is done. So far my code is: public void Upload(string filename, string url) { FileInfo fileInf = new FileInfo(filename); string uri = "ftp://" + url +…
user785039
24
votes
7 answers

Upload file on FTP

I want to upload file from one server to another FTP server and following is my code to upload file but it is throwing an error as: The remote server returned an error: (550) File unavailable (e.g., file not found, no access). This my…
R.D.
  • 7,153
  • 7
  • 22
  • 26
23
votes
9 answers

How can I use FTP to move files between directories?

I have a program that needs to move a file from one directory to another on an FTP server. For example, the file is in: ftp://1.1.1.1/MAIN/Dir1 and I need to move the file to: ftp://1.1.1.1/MAIN/Dir2 I found a couple of articles recommending use…
Paul Michaels
  • 16,185
  • 43
  • 146
  • 269
21
votes
4 answers

C# class to parse WebRequestMethods.Ftp.ListDirectoryDetails FTP response

I'm creating a service to monitor FTP locations for new updates and require the ability to parse the response returned from a FtpWebRequest response using the WebRequestMethods.Ftp.ListDirectoryDetails method. It would be fairly easy if all…
Gavin
  • 5,629
  • 7
  • 44
  • 86
20
votes
1 answer

C# Download all files and subdirectories through FTP

General Info I'm still in the process of learning C#. To help myself out, I'm trying to create a program that will automatically synchronise all of my local projects with a folder on my FTP server. This so that whether I'm at school or at home, I…
icecub
  • 8,615
  • 6
  • 41
  • 70
19
votes
3 answers

FtpWebRequest 30 minute time out

My code is experiencing a time out exception after exactly 30 minutes when downloading a large file over FTP. The server is FileZilla running on Windows. We have an SSL certificate configured with options Enable FTP over SSL/TLS support (FTPS) and…
Igor
  • 60,821
  • 10
  • 100
  • 175
19
votes
2 answers

Transfer files over FTPS (SSL/TLS) using C#.Net

I'm writing an application that syncs files over an FTP site. Right now it's working by connecting through regular FTP, but now our IT guys want to set this up over a secure FTPS connection. They provided me with a *.cr_ certificate file. If I open…
Eric Anastas
  • 21,675
  • 38
  • 142
  • 236
15
votes
4 answers

Retrieving creation date of file (FTP)

I'm using the System.Net.FtpWebRequest class and my code is as follows: FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://example.com/folder"); request.Method = WebRequestMethods.Ftp.ListDirectory; request.Credentials = new…
Radu
  • 8,561
  • 8
  • 55
  • 91
1
2 3
40 41