FTP not supported through http proxy

  • Thread starter Thread starter deostroll
  • Start date Start date
D

deostroll

I have got a web proxy through which I am able to browse the internet.
However when I try to perform ftp uploads I get an
InvalidOperationException saying that FTP commands cannot be issued
over a HTTP proxy.


System.InvalidOperationException was unhandled
Message="The requested FTP command is not supported when using HTTP
proxy."
Source="System"
StackTrace:
at System.Net.FtpWebRequest.GetHttpWebRequest()
at System.Net.FtpWebRequest.GetRequestStream()
at rcvfileUploader.Program.Main(String[] args) in C:\Arun
\JobsUploader\rcvfileUploader\rcvfileUploader\Program.cs:line 23
at System.AppDomain._nExecuteAssembly(Assembly assembly, String
[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
 
I thought FTP and HTTP are two entirely different protocols....how does one
relate to the other??

Mark
 
I thought FTP and HTTP are two entirely different protocols....how does one
relate to the other??

Mark

--
Mark Salsbery
Microsoft MVP - Visual C++


I have got a web proxy through which I am able to browse the internet.
However when I try to perform ftp uploads I get an
InvalidOperationException saying that FTP commands cannot be issued
over a HTTP proxy.
System.InvalidOperationException was unhandled
 Message="The requested FTP command is not supported when using HTTP
proxy."
 Source="System"
 StackTrace:
      at System.Net.FtpWebRequest.GetHttpWebRequest()
      at System.Net.FtpWebRequest.GetRequestStream()
      at rcvfileUploader.Program.Main(String[] args) in C:\Arun
\JobsUploader\rcvfileUploader\rcvfileUploader\Program.cs:line 23
      at System.AppDomain._nExecuteAssembly(Assembly assembly, String
[] args)
      at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
      at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
      at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
      at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
      at System.Threading.ThreadHelper.ThreadStart()

We usually connect to the internet through a proxy server, which is
why I get the problem I think.

--deostroll
 
I have got a web proxy through which I am able to browse the internet.
However when I try to perform ftp uploads I get an
InvalidOperationException saying that FTP commands cannot be issued
over a HTTP proxy.

System.InvalidOperationException was unhandled
  Message="The requested FTP command is not supported when using HTTP
proxy."
  Source="System"
  StackTrace:
       at System.Net.FtpWebRequest.GetHttpWebRequest()
       at System.Net.FtpWebRequest.GetRequestStream()
       at rcvfileUploader.Program.Main(String[] args) in C:\Arun
\JobsUploader\rcvfileUploader\rcvfileUploader\Program.cs:line 23
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String
[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
       at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
       at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

Have you looked at the documentation for
FtpWebRequest.GetRequestStream? There is a list of commands that are
accepted, and anything else is listed as throwing the exception you
see.

http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.getrequeststream(VS.80).aspx
 
I have got a web proxy through which I am able to browse the internet.
However when I try to perform ftp uploads I get an
InvalidOperationException saying that FTP commands cannot be issued
over a HTTP proxy.
System.InvalidOperationException was unhandled
  Message="The requested FTP command is not supported when using HTTP
proxy."
  Source="System"
  StackTrace:
       at System.Net.FtpWebRequest.GetHttpWebRequest()
       at System.Net.FtpWebRequest.GetRequestStream()
       at rcvfileUploader.Program.Main(String[] args) in C:\Arun
\JobsUploader\rcvfileUploader\rcvfileUploader\Program.cs:line 23
       at System.AppDomain._nExecuteAssembly(Assembly assembly,String
[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
       at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
       at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

Have you looked at the documentation for
FtpWebRequest.GetRequestStream?  There is a list of commands that are
accepted, and anything else is listed as throwing the exception you
see.

http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.getr...

Hi,
I guess I've found a solution. I found it discussed in the msdn
forums. You have something called a proxy as a property for an
FtpWebRequest. Just initialize it with an empty instance...

myFtpRequestObj.Proxy = new WebProxy();

--deostroll
 
Back
Top