471,120 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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.Create("ftp://ftp...../test.txt")
request.Method = WebRequestMethods.Ftp.UploadFile
request.Credentials = New
NetworkCredential(ftp_site_user_name, ftp_site_password)

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

Dim filecontents() As Byte =
Encoding.UTF8.GetBytes(sourceStream.ReadToEnd())

sourceStream.Close()
request.ContentLength = filecontents.Length

Dim requestStream As Stream =
request.GetRequestStream()
requestStream.Write(filecontents, 0,
filecontents.Length)
requestStream.Close()

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 10351
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.Create("ftp://ftp...../test.txt")
request.Method = WebRequestMethods.Ftp.UploadFile
request.Credentials = New
NetworkCredential(ftp_site_user_name, ftp_site_password)

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

Dim filecontents() As Byte =
Encoding.UTF8.GetBytes(sourceStream.ReadToEnd())

sourceStream.Close()
request.ContentLength = filecontents.Length

Dim requestStream As Stream =
request.GetRequestStream()
requestStream.Write(filecontents, 0,
filecontents.Length)
requestStream.Close()

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.Create("ftp://ftp...../test.txt")
request.Method = WebRequestMethods.Ftp.UploadFile
request.Credentials = New
NetworkCredential(ftp_site_user_name, ftp_site_password)

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

Dim filecontents() As Byte =
Encoding.UTF8.GetBytes(sourceStream.ReadToEnd())

sourceStream.Close()
request.ContentLength = filecontents.Length

Dim requestStream As Stream =
request.GetRequestStream()
requestStream.Write(filecontents, 0,
filecontents.Length)
requestStream.Close()

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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by bmiras | last post: by
7 posts views Thread by Todd McNeill | last post: by
2 posts views Thread by pradeep_TP | last post: by

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.