Re: steam url out to a client

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi

I am all ready fetching files from the local file system using

Response.TransmitFile(filePath);

and I eaither set this to make the save as dailog appear
Response.AppendHeader("Content-Disposition", " attachment; filename=" +
fileName);

or this to make the brouser to try and load it
Response.AppendHeader("Content-Disposition", " inline; filename=" +
fileName);

My problems come when the file I want to return is not the local file
but been returned by a remote service

I was just have problems get the streaming to work and have been able
to find any examples of this been done

will WebClient.DownloadData work with DPF/DOC files


Thanks for you help Paul


I do like the idea of change this into a ashx page when it is all
working


On Dec 11, 2:21 pm, "Dave Sexton" <dave@jwa[remove.this]online.com>
wrote:
Hi Paul,

What I an expecting is a pdf/doc file if the file is found else I will
get an HTML error pageIt doesn't sound to me like you're using a Web Service at all then :)

It sounds to me like you're simply making an HTTP request for a document
directly to a web server, in which case Marc's solutions are good ones.

I do wish to be able to forse the file into dowmload mode ie. havw to
links per file download - viewIt's not clear to me what you want here. Do you mean asynchronous
downloads?

some of these file will be big so I do need to be carefull not to
overload the server etc.

So It might be safer to write to the file systemWell, if you're going to be downloading the complete files into memory
anyway then writing them to disc will actually be more of a burden on the
server. Marc's suggestion about downloading large files in chunks seems
like it might be appropriate for your situation. Just write each chunk to
the Response.OutputStream one at a time. The size of the chunks should
depend on the available resources of the system that is hosting your
application, although you'll probably be able to get away with hard-coding
some size like 0x20000.

--
Dave Sexton

.



Relevant Pages

  • Re: loading files from a jar
    ... >Had something working just fine when the files where on the local file ... >system but now that I have them in a jar it's not working. ... You gave it a relative URL which I presume it is interpreting as: ... a file in the CWD of the local file system, ...
    (comp.lang.java.programmer)
  • Re: Tab-completion for file URLs in Firefox?
    ... One thing I miss is the ability to navigate to a local file using ... tab-completion, the same way you do in bash. ... can just select it with your arrow key or continue typing the filename. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • FP 2000 and Relative URLs
    ... select it from the filename list, but in either case the name is changed to ... According to help, relative URLs are the default, so there is no reference ... so it is treated as a local file in the current ... and as a file in the current server directory ...
    (microsoft.public.frontpage.client)
  • Re: Switch from /var/mail/username to IMAP and how to move folders
    ... directory on the local file system and I keep a ... If I go with IMAP, is it correct that I can choose ... whether to keep my mail folders on the local file system (i.e. like ... now) or to have them on the IMAP server? ...
    (comp.mail.mutt)
  • Re: Switch from /var/mail/username to IMAP and how to move folders
    ... directory on the local file system and I keep a ... If I go with IMAP, is it correct that I can choose ... whether to keep my mail folders on the local file system (i.e. like ... now) or to have them on the IMAP server? ...
    (comp.mail.mutt)