473,587 Members | 2,588 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.Crea te(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.Met hod = WebRequestMetho ds.Ftp.Download File;

Any help is much appreciated.

Håvard

Mar 21 '06 #1
0 1403

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

Similar topics

7
16207
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 working directory on the server to the parent directory? 2) Why cant I do this, or why doesn't work? In Internet explorer works! <some code...for...
0
2759
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 from the Internet Explorer so I have rights to do it. Why is the 2.0 FtpWebRequest class failing? What I am doing wrong? My Code:
2
10325
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 = (FtpWebRequest)WebRequest.Create("ftp://integration300:20/"); request.Method = WebRequestMethods.Ftp.ListDirectory; request.UsePassive = false; request.Credentials = new...
3
9711
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 the new folder If use the command line to do that,it just use the "CD" command can finish.But there is not the command in WebRequestMethods.Ftp
6
9424
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 out how.
0
1093
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, and the FTP server sends the data routed through a different host. This does not seem to work with FTPWebRequest, as I keep getting a "The data...
2
1883
by: deciacco | last post by:
is there way to use the ftpwebrequest class to send the list -r command? thanks
9
3896
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 with an FTP site that I setup on IIS. However, I have an issue at the customer site. Their FTP server is on Linux, but I presume that is not an...
0
1858
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 and send retrieve command without changint the location? Maybe there is some other approach for it? I'm on .Net 2. I read there is some ActiveX...
0
7918
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5713
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.