The requested FTP command is not supported when using HTTP proxy

C

chris

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.
 
S

savvas.ioannides

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
 
M

Mark Rusnak

Try request.Proxy = nothing;

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
 
Joined
Nov 13, 2007
Messages
1
Reaction score
0
request.Proxy = null;
will solve the problem if you can edit the code.

if you don't have the access to the code then
remove the use proxy check in internet explorer settings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top