Al descargar imagenes y archivos relativamente pequenos no hay problema.
Pero si son muy grandes como 700 mb incluso menos, me da error.
esta es mi funcion:
Código:
Dim reqFTP As FtpWebRequest
Dim fileName As String = System.IO.Path.GetFileName(Me.UrlString)
Dim descFilePath As String = System.IO.Path.Combine(Me.DestDir, fileName)
Try
reqFTP = DirectCast(FtpWebRequest.Create(Me.UrlString), FtpWebRequest)
reqFTP.Method = WebRequestMethods.Ftp.DownloadFile
reqFTP.UseBinary = True
Using outputStream As New FileStream(descFilePath, FileMode.OpenOrCreate)
Using response As FtpWebResponse = DirectCast(reqFTP.GetResponse(), FtpWebResponse)
Using ftpStream As Stream = response.GetResponseStream()
Dim bufferSize As Integer = 2048
Dim readCount As Integer
Dim buffer As Byte() = New Byte(bufferSize - 1) {}
readCount = ftpStream.Read(buffer, 0, bufferSize)
While readCount > 0
outputStream.Write(buffer, 0, readCount)
readCount = ftpStream.Read(buffer, 0, bufferSize)
End While
End Using
End Using
End Using
Return True
Catch ex As Exception
Throw New Exception("Failed to download", ex.InnerException)
End Try
End Function
Alguien tiene idea de algun metodo de como descargar un archivo externo de 4gb via asp.net al PC del cliente.
Se agradecera alguna ayuda.
No me vale response.redirect(Tengo mis motivos)
Saludos.