Uload File su FTP dietro un Proxy HTTP

martedì 07 giugno 2011 - 10.31
Tag Elenco Tags  VB.NET  |  .NET 4.0

luka82 Profilo | Junior Member

Utilizzo questo metodo per effettuare l'Upload su un server FTP:
[CODE] Dim UploadedBytes As Integer Dim ftp As Net.FtpWebRequest = CType(FtpWebRequest.Create(PercorsoFTP), FtpWebRequest) ftp.Credentials = New Net.NetworkCredential(UserName, Password) ftp.KeepAlive = False ftp.Method = Net.WebRequestMethods.Ftp.UploadFile ftp.UseBinary = True ftp.ContentLength = fi.Length Const BufferSize As Integer = 2048 Dim content(BufferSize - 1) As Byte, dataRead As Integer fs = fi.OpenRead() Using rs As Stream = ftp.GetRequestStream Do dataRead = fs.Read(content, 0, BufferSize) rs.Write(content, 0, dataRead) UploadedBytes += dataRead Loop Until dataRead < BufferSize rs.Close() End Using ftp = Nothing[/CODE]
solo che, se sono dietro un Proxy HTTP mi restituisce questo errore:
"il comando FTP richiesto non è supportato quando si utilizza un proxy HTTP"

Ho trovato su:http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx

If the Proxy property is set, either directly or in a configuration file, communications with the FTP server are made through the specified proxy. If the specified proxy is an HTTP proxy, only the DownloadFile, ListDirectory, and ListDirectoryDetails commands are supported.

C'è un metodo per risolvere?
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5