Re: File Download

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



One method you could use is to create as Web Service on the server hosting
the files. The a request can be made to your public server where an aspx
page will do any necessary processing to check there allowed to download the
requested file or not. The aspx page then set the response header
context-type to text/html, image/gif etc. or whatever you data file is.

Using SAOP you can then connect to your file server and request the file.
This will stream the file across in predefined chunks, which you write
direct to the response buffer and flush the results. You then request the
next chunk through the web service interface until the entire file has been
transferred. The method of requesting the next buffer can be accomplished in
several ways but by far the simplest is to use the current offset. For
example offset of 0 will send the first chunk of the file and you increment
the position by the size of the buffer until the entire file has been
received. This will allow the client side (web server) to specify the size
of the buffer as well so you can control the speed at which the user
receives the file. i.e. The higher the user status the faster you will try
and stream the file to them.

- Mike

---------------------------------------------------------------------------------
http://www.cogitar.net";> Cogitar Software. ( http://www.cogitar.net )
http://www.web-dominion.co.uk Web-Dominion. (Web Design and hosting )
http://www.shop-dominion.com (senery landscape picture gallery)
---------------------------------------------------------------------------------
"Jatin" <Jatin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D6DFAEF9-22C8-42C4-AE98-CEC480C3E38A@xxxxxxxxxxxxxxxx
> Hey Guys
> I have a web application that allows users to download files. But the
> files
> are not hosted on the webserver. The files are stored on external servers
> and
> are referenced by a URL/URI. Since my application restricts the number of
> downloads for the file per user, i cannot show the user the URL/URI of the
> server hosting the file.
> Therefore i need to some how route the file via my webserver, and then use
> the Response to stream the stream to the client.
>
> I have tried to work with the Webclient class, but the only download
> method
> i could use is readopen(others download the file directly to local drive),
> which works BUT since it downloads the whole file into a Byte[] which i
> then
> use the response to stream to the client is not the best of ways since the
> Byte[] is in memory and the files being downloaded can be large.
>
> Please Help., someway i can use some sort of unbuffered stream to do the
> trick.


.



Relevant Pages

  • Re: Asynchronous Web Service Call
    ... I think I understand your request so here goes.... ... How is the request handled from a consumer perpective? ... stage later when the web service process is complete, ... The background of my question adresses server to ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • RE: HTTP status 405: Method not allowed
    ... Try tracing the request at the web service. ... the server itself is not properly configured? ... Without the ASPNET user, I tested this server by running the simple ...
    (microsoft.public.dotnet.framework.webservices)
  • RE: The underlying connection was closed: An unexpected error occurred on a receive
    ... down thru the thread tells me that you know your web service logic is ... the server timeout logic does what it is designed to do ... Each request is allocated to ... you can log the batch and relate it to the caller assigned ID. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: HHTP file download:
    ... I simply sent a HEAD request to the server to get the content length before ... > give you a idea of how long its gonna take you to download the file. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: HHTP file download:
    ... I simply sent a HEAD request to the server to get the content length before ... > give you a idea of how long its gonna take you to download the file. ...
    (microsoft.public.dotnet.general)