473,513 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FTPWebRequest suddenly sends a USER command?

I've got a small utility here that downloads the contents of some
directory. Now, the weird thing is that sometimes I get an exception
when I start the download of a new file.
The exception I get is: The remote server returned an error: (500)
Syntax error, command unrecognized. I then used the Network Monitor to
track the traffic and it turns out that intermittently my app sends a
USER request to the server, which in turn returns the 500 message as
it's expecting a GET request.
There is no pattern as to which files it does this for, and it varies
from run to run.

The skeleton is basically ripped from the MS tutorial with some small
changes done by me.
It first connects and requests a listing off all the files in the
directory. I then pass the filename + the FtpWebRequest onto the
download function. At the start of the function I use the request and
create a new request and change the Method to Download file. If all
goes well it downloads the file.
connRequest = (FtpWebRequest)WebRequest.Create(downloadUrl);

I've got a nagging suspision that this ^ request creates the USER
request, but then, how come it doesn't do this for every single file?

connRequest.Method = WebRequestMethods.Ftp.DownloadFile;

Any help is much appreciated.

Håvard

Mar 21 '06 #1
0 1396

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
16198
by: jose.lopes.cruz | last post by:
I need to access a FTP Server. I'm using FTPWebRequest as described in visual studio 2005 documentation. Everything works fine except the following: 1) I dont know how to change de current...
0
2750
by: Alexis | last post by:
Hello, I am trying to upload a file to an ftp server using the FtpWebRequest class, but I get the following error. The requested URI is invalid for this FTP command. I do can upload the file...
2
10312
by: Ian Hannah | last post by:
I am running the following code (using VS 2005) with the appropriate username and password and the request always timeouts: FtpWebRequest request =...
3
9704
by: Kevien Lee | last post by:
hi everyone I have a quick question when i use the FtpWebRequest. What I need to do is that: Connect a FTP server,check whether there is a folder if not,create it, then changed the path to...
6
9411
by: William LaMartin | last post by:
Could someone show me how to use the FtpWebRequest and change to a different directory? Changing directories is not listed as one of the methods, but I believe it can be done--just can't figure...
0
1086
by: RodeoClownCC | last post by:
Hello, I'm trying to create a simple FTP client using VB .NET's FTPWebRequest methods, and have unfortunately run into a snag. The problem I'm having is the client connects to an FTP server,...
2
1873
by: deciacco | last post by:
is there way to use the ftpwebrequest class to send the list -r command? thanks
9
3887
by: Waldy | last post by:
Hi there, I have written a service in VS2005 that downloads files from an FTP site processes them and then deletes the files if successfully processed. It all works fine when run in our test lab...
0
1839
by: toka | last post by:
Hello, I need to write a code to download file from FTP server that has disabled command CWD/CD. As far as I learned by surfing the net, FtpWebRequest automatically sends CWD. How can I skip that...
0
7175
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7391
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7553
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7120
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5697
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1609
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
466
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.