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
15
votes
2 answers

"Requested URI is invalid" during upload with FtpWebRequest

I trying upload file to a directory on a FTP server. I used this method with FtpWebRequest. I would like to upload one file to a home directory for this user, but I always get the following error message: The requested URI is invalid for this FTP…
redrom
  • 11,502
  • 31
  • 157
  • 264
12
votes
5 answers

Upload file to FTP site using VB.NET

I have this working code from this link, to upload a file to an ftp site: ' set up request... Dim clsRequest As System.Net.FtpWebRequest = _ DirectCast(System.Net.WebRequest.Create("ftp://ftp.myserver.com/test.txt"),…
Somebody
  • 2,667
  • 14
  • 60
  • 100
12
votes
1 answer

Is it possible to do "Active" mode FTP using FtpWebRequest?

Due to some firewall issues, we need to do FTP using "active" mode (i.e. not by initiating a PASV command). Currently, we're using code along the lines of: // Get the object used to communicate with the server. FtpWebRequest request =…
Rowland Shaw
  • 37,700
  • 14
  • 97
  • 166
12
votes
2 answers

Downloading files using FtpWebRequest

I'm trying to download a file using FtpWebRequest. private void DownloadFile(string userName, string password, string ftpSourceFilePath, string localDestinationFilePath) { int bytesRead = 0; byte[] buffer = new byte[1024]; FtpWebRequest…
Rick Eyre
  • 2,355
  • 4
  • 20
  • 26
12
votes
2 answers

Uploading files to FTP are corrupted once in destination

I'm creating a simple drag-file-and-upload-automatically-to-ftp windows application and I'm using the MSDN code to upload the file to the FTP. The code is pretty straight forward: // Get the object used to communicate with the…
balexandre
  • 73,608
  • 45
  • 233
  • 342
12
votes
4 answers

Parsing FtpWebRequest ListDirectoryDetails line

I need some help with parsing the response from ListDirectoryDetails in C#. I only need the following fields. File Name/Directory Name Date Created and the File Size. Here's what some of the lines look like when I run…
zSynopsis
  • 4,854
  • 21
  • 69
  • 106
11
votes
2 answers

Upload a file to an FTP server from a string or stream

I'm trying to create a file on an FTP server, but all I have is either a string or a stream of the data and the filename it should be created with. Is there a way to create the file on the server (I don't have permission to create local files) from…
Jamie Twells
  • 1,924
  • 4
  • 26
  • 56
11
votes
1 answer

The remote server returned an error: 227 Entering Passive Mode (500 oops vs_utility_recv_peek: no data)

I am having a problem connecting a Windows service to an FTP site. I inherited a Windows service from another developer. The service connects to a 3rd party server, downloads a csv file and then processes it. For some reason, the service stopped…
odinel
  • 566
  • 1
  • 5
  • 28
10
votes
2 answers

Unable to rename file with ftp methods when current user directory is different from root

Remark: due to spam prevention mechanizm I was forced to replace the beginning of the Uris from ftp:// to ftp. I've got following problem. I have to upload file with C# ftp method and afterwards rename it. Easy, right? :) Ok, let's say my ftp host…
Agata
  • 131
  • 1
  • 2
  • 7
10
votes
3 answers

FTP upload file The requested FTP command is not supported when using HTTP proxy

Can someone please take a look at the code below and tell me what I am doing wrong. I am just going in circles,,, any pointers greatly appreciated public class FtpWebRequestUtil { private static string RemoteHost; private static string…
vishal
  • 640
  • 1
  • 5
  • 21
10
votes
3 answers

Reusing FtpWebRequest

I'm trying to make a simple method to download a file from an FTP using FtpWebRequest with the method WebRequestMethods.Ftp.DownloadFile. The problem is that I wan't to display the progress of downloading and thus need to know the file size ahead to…
SamWhan
  • 8,296
  • 1
  • 18
  • 45
10
votes
1 answer

Check if directory exists on FTP server

I'm running a check to see if a directory exists on my FTP server: public bool DirectoryExists(string directory) { bool directoryExists; var request = (FtpWebRequest)WebRequest.Create(directory); request.Method =…
PiousVenom
  • 6,888
  • 11
  • 47
  • 86
10
votes
3 answers

FTP "ls -lt" command: How does it list the file details for Linux FTP and Windows FTP server?

I am writing FTP client that should work for at least Windows and Linux FTPs. BUt before I proceed, I want answer to these questions. In which order files are listed when FTP ls -lt command is used for the FTP server on the Linux? Is there any…
Learner
  • 4,661
  • 9
  • 56
  • 102
9
votes
3 answers

Set Port number when using FtpWebRequest in C#

I keep getting a exception when I try to FTP to my Win 2008 Server from C# code using VS2008 as debugger. My test class looks like this: public class FTP { private string ftpServerIP = "192.168.10.35:21"; private string ftpUserID =…
The real napster
  • 2,274
  • 7
  • 23
  • 33
9
votes
2 answers

Retrieving list of FTP file names only, without additional details

I'm trying to download the contents of an FTP folder to a local folder using a this example on StackOverflow: Downloading a list of files from ftp to local folder using c#? The code I have at the moment is: public void DownloadFilesFromFTP(string…
Michael A
  • 9,480
  • 22
  • 70
  • 114
1
2
3
40 41