Absolutely. You have access to all of the response object methods you would
in a servlet to do this with.

Set the correct content type and content length headers and spit it to the
outputstream. Return a null findForward.

I've done this with pdf files, (and this week I asked on this list about img
tags. Was even easier: It worked the same way, but with none of the header
setting apparently. Least I hope so :-).

In fact, the file doesn't even need to be accessible via a browser
accessible URL. If the application can read it, that's all you need.


> -----Original Message-----
> From: Mike Elliott [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 16, 2004 10:26 PM
> To: [EMAIL PROTECTED]
> Subject: Making a file available?
>
>
> I have an application which gathers information about internal
> processes.  Some of this information is in the form of a text file, an
> Excel file, a PDF file, etc.
>
> What I need to be able to do is to make a URL available to users which
> will provide a requested file to a user; that is, if the URL
> refers to a
> PDF file then when a user makes that request, his browser will detect
> that the request was for a PDF file and properly render it in xpdf or
> acrobat or whatever.
>
> For example, if a user entered the url
>
> http://www.blip.org/getFile.do?name=xyz.pdf
>
> the result would be his browser properly displaying the contents of
> xyz.pdf.
>
> Is this even possible?  If so, how would I go about doing it?  We can
> assume that the server knows where to find any named file and
> furthermore that it knows the MIME type of the file (in this case
> application/x-pdf).
>
> Any ideas?
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to