473,791 Members | 3,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The requested FTP command is not supported when using HTTP proxy

Hi,

I am trying to upload files on FTP and used the code below:

Dim request As FtpWebRequest

request =
WebRequest.Crea te("ftp://ftp...../test.txt")
request.Method = WebRequestMetho ds.Ftp.UploadFi le
request.Credent ials = New
NetworkCredenti al(ftp_site_use r_name, ftp_site_passwo rd)

Dim sourceStream As New
StreamReader("C :\Documents and Settings\...... .\text.txt")

Dim filecontents() As Byte =
Encoding.UTF8.G etBytes(sourceS tream.ReadToEnd ())

sourceStream.Cl ose()
request.Content Length = filecontents.Le ngth

Dim requestStream As Stream =
request.GetRequ estStream()
requestStream.W rite(fileconten ts, 0,
filecontents.Le ngth)
requestStream.C lose()

When I define to use proxy (in Interent options/connections/LAN
settings) I receive an error "The requested FTP command is not
supported when using HTTP proxy". When I define NOT to use proxy, the
file is transfered on FTP.

1. Is there a way for defining to bypass the proxy for this ftp
connection ?

2. Can I create subdirectories on FTP from code ?

3. StreamReader reads TXT files. How can I read ZIP files for uploading
on FTP ?

Thanks a lot.

May 31 '06 #1
2 10694
Hi Chirs,

I am having the same problem. Did you find a solution?

I am new in asp and I also have problems with this exception:

"The requested URI is invalid for this FTP command"

I paste the URI in windows explorer and I don't have any problems.

Any ideas?

Thanks a lot

Savvas

chris wrote:
Hi,

I am trying to upload files on FTP and used the code below:

Dim request As FtpWebRequest

request =
WebRequest.Crea te("ftp://ftp...../test.txt")
request.Method = WebRequestMetho ds.Ftp.UploadFi le
request.Credent ials = New
NetworkCredenti al(ftp_site_use r_name, ftp_site_passwo rd)

Dim sourceStream As New
StreamReader("C :\Documents and Settings\...... .\text.txt")

Dim filecontents() As Byte =
Encoding.UTF8.G etBytes(sourceS tream.ReadToEnd ())

sourceStream.Cl ose()
request.Content Length = filecontents.Le ngth

Dim requestStream As Stream =
request.GetRequ estStream()
requestStream.W rite(fileconten ts, 0,
filecontents.Le ngth)
requestStream.C lose()

When I define to use proxy (in Interent options/connections/LAN
settings) I receive an error "The requested FTP command is not
supported when using HTTP proxy". When I define NOT to use proxy, the
file is transfered on FTP.

1. Is there a way for defining to bypass the proxy for this ftp
connection ?

2. Can I create subdirectories on FTP from code ?

3. StreamReader reads TXT files. How can I read ZIP files for uploading
on FTP ?

Thanks a lot.


Jun 21 '06 #2
Try request.Proxy = nothing;

sa************* *@gmail.com wrote:
Hi Chirs,

I am having the same problem. Did you find a solution?

I am new in asp and I also have problems with this exception:

"The requested URI is invalid for this FTP command"

I paste the URI in windows explorer and I don't have any problems.

Any ideas?

Thanks a lot

Savvas

chris wrote:
Hi,

I am trying to upload files on FTP and used the code below:

Dim request As FtpWebRequest

request =
WebRequest.Crea te("ftp://ftp...../test.txt")
request.Method = WebRequestMetho ds.Ftp.UploadFi le
request.Credent ials = New
NetworkCredenti al(ftp_site_use r_name, ftp_site_passwo rd)

Dim sourceStream As New
StreamReader("C :\Documents and Settings\...... .\text.txt")

Dim filecontents() As Byte =
Encoding.UTF8.G etBytes(sourceS tream.ReadToEnd ())

sourceStream.Cl ose()
request.Content Length = filecontents.Le ngth

Dim requestStream As Stream =
request.GetRequ estStream()
requestStream.W rite(fileconten ts, 0,
filecontents.Le ngth)
requestStream.C lose()

When I define to use proxy (in Interent options/connections/LAN
settings) I receive an error "The requested FTP command is not
supported when using HTTP proxy". When I define NOT to use proxy, the
file is transfered on FTP.

1. Is there a way for defining to bypass the proxy for this ftp
connection ?

2. Can I create subdirectories on FTP from code ?

3. StreamReader reads TXT files. How can I read ZIP files for uploading
on FTP ?

Thanks a lot.


Jun 22 '06 #3

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

Similar topics

2
7684
by: Robert | last post by:
I am using the php4-cgi Debian package which is based on PHP 4.3.4. I have problems when running php4 on the command line. If I say something like $ php4 index.cgi a number of variables are not initialized. For example, $HTTP_GET_VARS is not set. To get it set, here's my workaround:
4
4463
by: bmiras | last post by:
I've got a problem using urllib2 to get a web page. I'm going through a proxy using user/password authentification and i'm trying to get a page asking for a HTTP authentification. And I'm using python 2.3 Here is an exemple of the piece of code I use: import urllib2 #Proxy handler proxy_handler = urllib2.ProxyHandler({"http" :
7
7406
by: Todd McNeill | last post by:
Hi- Something was just pointed out to me this morning. According to the V8 Command Reference, the RUNSTATS command no longer uses the SHRLEVEL CHANGE/REFERENCE clauses, and it looks to be replaced with ALLOW READ/WRITE ACCESS. Is SHRLEVEL still a valid clause and interchangable with ALLOW..., or has it been deprecated and is it, or will it eventually become, invalid? We currently are not seeing any errors using SHRLEVEL in our...
10
8209
by: Clint | last post by:
Hey all - I'm having a really confusing problem concerning a web service. Right now, I have an application that needs to call a web service that does nothing but return "true" (this will obviously change once the program's fully built to actually do something, but for testing, it works). The only code I added to the service is below:
3
2508
by: bfprog | last post by:
Using IBM iSeries client access OLEDB provider to connect to DB2 on AS/400, but cannot create connection using .NET web app. Using following code: Dim cnTest As New OleDbConnection("Provider=IBMDA400; Data Source=S10324NM; User ID=THEUSER; Password=THESECRET") Works fine in console app, but fails in web app with: System.Security.SecurityException: Requested registry access is not allowed.
2
4590
by: pradeep_TP | last post by:
I am new to web services. I created a very simple web service with a method that returns a simple string object. I added a web reference to this web service from another project and I could successfully call the method. Now, I want to understand why many suggests to create a proxy object of the web service and then call the method using this proxy object. What is the difference between creating a proxy object using WSDL utility and...
5
4917
by: CindyRob | last post by:
Using .NET framework 1.1 SP1, .NET framework SDK 1.1 SP1, Visual Studio .NET 2003, hotfixes 892202 and 823639. I create a proxy class using wsdl.exe, and in the serialized XML request, I see that any elements that are nested elements in the schema (not global elements) have their namespaces set to the null namespace. I can see that the proxy classes have serialization attributes specifying these nested elements as unqualified: ///...
0
2120
by: J Ames | last post by:
Please, if this is the incorrect forum for this question, let me know which forum is most appropriate. I want to make sure I get visibility with the proper gurus! I have a .NET console app that consumes an external web service. It has passed a userid and password to a web proxy object to pass through our corporate proxy server and has been running fine for weeks. Our operations staff has just changed the proxy server so that it now...
2
4293
by: =?Utf-8?B?QW5keSBD?= | last post by:
Hi, I'm trying to load some XML into a dataset with C# but I have an issue with the schema. I'm using exactly the same code to successfully load other XML. The only difference is in the XML I'm trying to load it has: xs:choice maxoccurs="unbounded" The error message I'm getting is: "The 'maxoccurs' attribute is not
0
9669
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10427
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10155
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9995
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6776
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5431
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.