Questions tagged [ftpwebresponse]

A .NET Framework class, representing a response from FTP server, used by FtpWebRequest

Documentation: https://msdn.microsoft.com/en-us/library/system.net.ftpwebresponse.aspx

43 questions
1
vote
1 answer

Ftp Upload gives exception Unable to write data to the transport connection. An existing connection was forcibly closed by the remote host

I have a windows form application in which i am using a background worker to ftp upload files. After uploading 209 files successfully it gave error on file which only had size of 7.8kb that While Processing Img1.jpg Unable to write data to the…
PUG
  • 4,301
  • 13
  • 73
  • 115
1
vote
1 answer

Check FTP delete permission without trying to delete a file

I have to check whether an FTP Server allows me to delete a file or not. Without deleting an existing file or sending a file and trying to delete that file. For now, I use the 'Send a file and try to Delete it' dummy solution, but sometimes I don't…
Mohammad-R
  • 307
  • 2
  • 11
1
vote
2 answers

Get FTP file details based on datetime in C#

Question: I want to get file Details from FTP server based on some specific datetime without using any 3rd party. Problem : My FTP server contains 1000s of files so getting all files and after that filtering it takes time. Is there any Quicker way…
developer_.net
  • 196
  • 3
  • 14
1
vote
3 answers

StreamReader ReadLine throwing disposed exception rather than returning null

I'm trying to fetch a text file from an FTP server, then read it line by line, adding each line to a list. My code seems to fit the standard pattern for this: var response = (FtpWebResponse)request.GetResponse(); using (var…
Mort432
  • 86
  • 1
  • 9
1
vote
2 answers

Displaying progress while uploading data

I am using the following code located here to upload files Public Function UploadFile(ByVal oFile As FileInfo) As Boolean Dim ftpRequest As FtpWebRequest Dim ftpResponse As FtpWebResponse Try ftpRequest = CType(FtpWebRequest.Create(FTPSite +…
OrElse
  • 9,709
  • 39
  • 140
  • 253
1
vote
1 answer

FtpWebResponse fails to create directory for WebRequestMethods.Ftp.MakeDirectory method for a specific directory name on Ubuntu server

I'm trying to stress-test my .NET application's function that uploads files via FTP(s) protocol. This function uses the .NET's built-in FtpWebResponse class (in case a user's server does not support SSH connection.) I'm using the following code to…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
1
vote
2 answers

Why does FtpWebRequest return an empty stream for this existing directory?

I'm not sure why am I getting this result. I'm running this on a Linux server. (It's my small web site's shared web hosting account.) The files are grouped as follows: and the Another Dir has one file inside: So I'm trying to retrieve the contents…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
1
vote
2 answers

WebRequestMethods.Ftp.ListDirectory result is limited to 2000 entries only

Sending the ListDirectory to an FTP server but returns the first 2000 items from the FTP only. Adding SSL did not return more results. Is there another library I should be using to get the full…
juanvan
  • 671
  • 7
  • 19
1
vote
4 answers

how to differentiate among different exceptions of same class?

how to check whether its is login info exception or a connection lost exception if the the exceptions are form the same class? private bool checkFileExists(string absoluteRemoteLocation) { try { FtpWebRequest request =…
Raman
  • 216
  • 3
  • 15
1
vote
2 answers

Read FTP file with international characters

I am downloading a FTP location file using below code. Its working for all of the files except where the file name contains international character. I have learned in the URI format such this is not allowed but how can download if there is existing…
Pratik
  • 1,472
  • 7
  • 20
  • 36
1
vote
2 answers

How to create a fake FtpWebResponse

I am trying to fake an FtpWebRequest.GetResponse() for an integration test, but without using a server. What I have been trying to do is the simple return a fake FtpWebResponse but, you are not allowed to access the constructor for the…
DJ Burb
  • 2,346
  • 2
  • 29
  • 38
1
vote
3 answers

Write And Read .txt files from FTP with C#

Is it possible to write a txt file on ftp (not upload a file to ftp!) Directly writing a txt file on ftp server) and read from a file on a ftp (not download a file from ftp!) Directly read from a txt file on ftp server? I searched but ı found upload…
Mehmet
  • 1,824
  • 3
  • 19
  • 28
0
votes
0 answers

Getting "The underlying connection was closed: An unexpected error occurred on a receive." on FTPWebResponse.close()

I have a VB.Net function that will check if the FTP directory exists, otherwise create the directory. The function works fine at first, but when the number of files in the FTP directory has reached a certain limit, response.close() in the finally…
0
votes
3 answers

StreamReader ReadToEnd() gives different results for txt files on different servers

I have created a small FTP program, it's just for my own use, so login details + the file paths are hard coded. I have a button which starts the downloading process of two txt files - the contents of these are put into two different textboxes. The…
gosr
  • 4,593
  • 9
  • 46
  • 82
0
votes
1 answer

I am trying to list all the files present in the ftp server using c# winforms application

FtpWebRequest request = (FtpWebRequest)WebRequest.Create(serverUrl); request.Method = WebRequestMethods.Ftp.ListDirectory; var response = (FtpWebResponse)request.GetResponse(); Stream rStream = response.GetResponseStream(); …