Re: Moving large media files over the internet securily

Tech-Archive recommends: Speed Up your PC by fixing your registry



I currently use httpwebrequest to download huge files from my server. I have
not had any luck in posing a large byte array to a virtual folder on my
server using httpwebrequest. This is my download code which work well in
returning a large byte array from the server:

Function GetImageFromURL(ByVal url As String) As Byte()
allDone.Reset()
Try
Dim wr As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest)
If Not ProxyObject Is Nothing Then wr.Proxy = ProxyObject
Dim MRS As New RequestState
MRS.request = wr
Dim result As IAsyncResult = CType(wr.BeginGetResponse(AddressOf
RespCallBack, MRS), IAsyncResult)
allDone.WaitOne()
MRS.response.Close()
Return MRS.ReturnBLOB
Catch MyException As Exception
End Try
End Function

Private Sub RespCallBack(ByVal asyncResult As IAsyncResult)
Dim MRS As RequestState = CType(asyncResult.AsyncState, RequestState)
Dim wr2 As HttpWebRequest = CType(MRS.request, HttpWebRequest)
MRS.response = CType(wr2.EndGetResponse(asyncResult), HttpWebResponse)
Dim RS As Stream = MRS.response.GetResponseStream()
MRS.responseStream = RS
Dim br As BinaryReader = New BinaryReader(MRS.responseStream)
Dim bytesize As Long = MRS.response.ContentLength
MRS.ReturnBLOB = br.ReadBytes(CInt(bytesize))
allDone.Set()
End Sub

I need to see how to modify this code to perform the post of a large byte
array to the url????? I have been struggleing for 2 weeks now to get post to
work without success.

Fred Herring




"Dekel" wrote:

> SSL (https) should provide the needed security.
>
> The only problem I can see with large file transfer over the internet
> is that one of the connections in the chain b/w server and client might
> get closed in the middle of the transfer and thus require resend of the
> whole file again.
> In order to overcome this you can use (or write your) client that
> request ranges of the file and retry the missing range only instead of
> the entire file - if the connection was lost, and reassemble the file
> parts on the client.
>
> For SSL client you can use HttpWebRequest
>
> HTH
>
> Dekel Israeli
>
>
.



Relevant Pages

  • Re: socket error
    ... It ended up with something to do with our Proxy configuration. ... but on the 2.0 box for some reason the httpwebrequest couldnt ... Yes I can visit that page directly through a browser on the server. ... >> | Dim returnstr As String ...
    (microsoft.public.dotnet.framework.aspnet)
  • httpwebrequest credentials
    ... I am having a problem communicating with a remote server using ... authentication credentials. ... -- Our httpwebrequest to the other internal servers works fine when run on ... Dim postData As String ...
    (microsoft.public.dotnet.framework.aspnet)
  • The remote server returned an error: (404) Not Found
    ... I am facing an Exception "The remote server returned an error: ... by using "getRequestStream" method of HttpWebRequest object to send data. ... Dim strPostData As New StringBuilder ... Dim objWebRequest As HttpWebRequest = ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • System.Net.WebException
    ... connect to the remote server. ... at System.Net.Connection.TunnelThroughProxy(Uri proxy, HttpWebRequest ... at Proceso.Proceso.MiRequest(String Method, String URL, String ... Dim res As HttpWebResponse ...
    (microsoft.public.dotnet.framework)
  • Re: Problems with WebRequest
    ... > I keep getting the error image from the server. ... Sub Page_Load ... Dim myReq as HttpWebRequest = WebRequest.Create ...
    (microsoft.public.dotnet.csharp.general)