473,408 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

WebException

I am getting the following error when trying to call
GetRequestStream(): System.Net.WebException: The requested URI is
invalid for this FTP command..

Code where the exception catches:

...
FtpWebRequest uploadRequest =
(FtpWebRequest)WebRequest.Create(uploadUrl);
uploadRequest.Method =
WebRequestMethods.Ftp.UploadFile;

// UploadFile is not supported through an Http proxy
// so we disable the proxy for this request.
uploadRequest.Proxy = null;

exception------ requestStream = uploadRequest.GetRequestStream();
fileStream = File.Open(fileName, FileMode.Open);
....

On my machine I set up a ftp server through IIS, allowed anonymous
connections and allowed read/write privileges. Anybody can shed some
light on this?

Nov 2 '07 #1
5 5795
Well, what is the url that you are passing to the request?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<re***********@gmail.comwrote in message
news:11**********************@y42g2000hsy.googlegr oups.com...
>I am getting the following error when trying to call
GetRequestStream(): System.Net.WebException: The requested URI is
invalid for this FTP command..

Code where the exception catches:

...
FtpWebRequest uploadRequest =
(FtpWebRequest)WebRequest.Create(uploadUrl);
uploadRequest.Method =
WebRequestMethods.Ftp.UploadFile;

// UploadFile is not supported through an Http proxy
// so we disable the proxy for this request.
uploadRequest.Proxy = null;

exception------ requestStream = uploadRequest.GetRequestStream();
fileStream = File.Open(fileName, FileMode.Open);
....

On my machine I set up a ftp server through IIS, allowed anonymous
connections and allowed read/write privileges. Anybody can shed some
light on this?

Nov 2 '07 #2
On Nov 2, 2:57 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Well, what is the url that you are passing to the request?

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

<repairman2...@gmail.comwrote in message

news:11**********************@y42g2000hsy.googlegr oups.com...
I am getting the following error when trying to call
GetRequestStream(): System.Net.WebException: The requested URI is
invalid for this FTP command..
Code where the exception catches:
...
FtpWebRequest uploadRequest =
(FtpWebRequest)WebRequest.Create(uploadUrl);
uploadRequest.Method =
WebRequestMethods.Ftp.UploadFile;
// UploadFile is not supported through an Http proxy
// so we disable the proxy for this request.
uploadRequest.Proxy = null;
exception------ requestStream = uploadRequest.GetRequestStream();
fileStream = File.Open(fileName, FileMode.Open);
....
On my machine I set up a ftp server through IIS, allowed anonymous
connections and allowed read/write privileges. Anybody can shed some
light on this?- Hide quoted text -

- Show quoted text -
I'm just accessing ftp://<myipaddress>/ it works fine if I open up
explorer and type in the address and create a file.

Nov 2 '07 #3
Are you using PASV or no when going through explorer? Also, are you
setting binary to true/false depending on how you want to upload the file?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<re***********@gmail.comwrote in message
news:11*********************@o3g2000hsb.googlegrou ps.com...
On Nov 2, 2:57 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
> Well, what is the url that you are passing to the request?

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

<repairman2...@gmail.comwrote in message

news:11**********************@y42g2000hsy.googleg roups.com...
>I am getting the following error when trying to call
GetRequestStream(): System.Net.WebException: The requested URI is
invalid for this FTP command..
Code where the exception catches:
...
FtpWebRequest uploadRequest =
(FtpWebRequest)WebRequest.Create(uploadUrl);
uploadRequest.Method =
WebRequestMethods.Ftp.UploadFile;
// UploadFile is not supported through an Http proxy
// so we disable the proxy for this request.
uploadRequest.Proxy = null;
exception------ requestStream = uploadRequest.GetRequestStream();
fileStream = File.Open(fileName, FileMode.Open);
....
On my machine I set up a ftp server through IIS, allowed anonymous
connections and allowed read/write privileges. Anybody can shed some
light on this?- Hide quoted text -

- Show quoted text -

I'm just accessing ftp://<myipaddress>/ it works fine if I open up
explorer and type in the address and create a file.

Nov 2 '07 #4
On Nov 2, 3:16 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Are you using PASV or no when going through explorer? Also, are you
setting binary to true/false depending on how you want to upload the file?

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

<repairman2...@gmail.comwrote in message

news:11*********************@o3g2000hsb.googlegrou ps.com...
On Nov 2, 2:57 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Well, what is the url that you are passing to the request?
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
<repairman2...@gmail.comwrote in message
>news:11**********************@y42g2000hsy.googleg roups.com...
I am getting the following error when trying to call
GetRequestStream(): System.Net.WebException: The requested URI is
invalid for this FTP command..
Code where the exception catches:
...
FtpWebRequest uploadRequest =
(FtpWebRequest)WebRequest.Create(uploadUrl);
uploadRequest.Method =
WebRequestMethods.Ftp.UploadFile;
// UploadFile is not supported through an Http proxy
// so we disable the proxy for this request.
uploadRequest.Proxy = null;
exception------ requestStream = uploadRequest.GetRequestStream();
fileStream = File.Open(fileName, FileMode.Open);
....
On my machine I set up a ftp server through IIS, allowed anonymous
connections and allowed read/write privileges. Anybody can shed some
light on this?- Hide quoted text -
- Show quoted text -
I'm just accessing ftp://<myipaddress>/ it works fine if I open up
explorer and type in the address and create a file.- Hide quoted text -

- Show quoted text -

I am not using PASV and I am not setting binary to true/false.

Nov 2 '07 #5
Found the problem. the URI needed to include the filename in it, not
just the address of the server. Thanks for you help though

Nov 5 '07 #6

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

Similar topics

0
by: Joe Bloggs | last post by:
I have a C# MRS application that uses the ReportingService's Render method to retrieve a byte array containing a report. The following error message occurs An unhandled exception of type...
2
by: genc_ ymeri at hotmail dot com | last post by:
Hi, I'm trying to recieve the response status code rather than the message in the below code : try { responseArray = myWebClient.UploadValues(uriString,"POST",myNameValueCollection); }...
2
by: G Joseph | last post by:
Hello, I am getting a WebException.TrustFailure when I call HttpwebRequest.GetResponse. Anybody has an idea how to resolve this issue? The code works correctly in other sites. I noticed that,...
0
by: Joey Guerra | last post by:
Hi. I've been researching how to resolve this issue, but haven't found a solution. I saw a post referring to the SecureChannelFailure WebException status, but no resolution. Any help/direction is...
1
by: Marcos Martínez | last post by:
I am trying to generate and to consume a file RSS dinamicamente. I generate it correctly, if I call from the explorer (http://localhost/Prueba/rss.aspx) or an application client RSS Bandit, for...
1
by: etantonio | last post by:
Good morning, I've a problem, in the past I translate my site from google or altavista with a code similar to this : <%@ Page Language="c#" Trace="true" Debug="true" %> <%@ import...
1
by: Stephen H. | last post by:
Hello, I'm developing a ppc-application that consumes a webservice on my local machine. For testing the service is the HelloWorld service and the app is just a form with a button that calls the...
2
by: tlan | last post by:
Hi, I got this error when I move my web service to Windows2003 server. I spent hours scouting on the internet and could find any answer. Please help!!! I the webservice is timeout between 1...
8
by: Tim Reynolds | last post by:
Our .Net application calls a web method of aplpication 2 that resides on their Apache server. When I as a developer C#, Studios 2003, make the call to their web method from my desktop, I receive no...
4
by: =?Utf-8?B?UGhpbGlwIEs=?= | last post by:
Simplifying the code a bit its like this: try { myRemotingObj.Myfunction(string, string,string,string,timeSpan) } catch(WebException) { commsUp = false; }
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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
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...
0
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,...
0
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...

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.