|Subject:||Re: How to serve a pdf file and view it inside the explorer|
|Posted by:||Remy Lebeau \(Indy Team\) (firstname.lastname@example.org)|
|Date:||Wed, 20 Feb 2008|
"Chus GZarco" <email@example.com> wrote in message
> When i serve the file, the explorer always ask to open the file
> and opens the file in another window.
> Is there any option to serve the pdf file to force the explorer
> to open it inside the explorer.
There is no way to control that on the server-side. That is client-side
behavior only, based on the user's browser configuration and installed
programs. If the user has an installed program that knows how to handle the
PDF's ContentType, the browser should automatically prompt the user how to
handle the file.
> AResponseInfo.ContentText := ExtractFileName( ArchivoInforme );
Don't do that. For one thing, because it won't be sent to the client when
using ServeFile() anyway.
> AResponseInfo.ContentType := MIMEMap.GetFileMIMEType( ArchivoInforme );
The server does that for you automatically.
How to serve a pdf file and view it inside the explorer posted by Chus GZarco on Wed, 20 Feb 2008