Re: Moving large media files over the internet securily
- From: Fred Herring <FredHerring@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 2 May 2005 08:01:03 -0700
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
>
>
.
- Follow-Ups:
- References:
- Prev by Date: Re: Heap performance?
- Next by Date: Re: Any news about the inlining problems?
- Previous by thread: Re: Moving large media files over the internet securily
- Next by thread: Re: Moving large media files over the internet securily
- Index(es):
Relevant Pages
|