Re: How to serve a pdf file and view it inside the explorer

Giganews Newsgroups
Subject: Re: How to serve a pdf file and view it inside the explorer
Posted by:  Remy Lebeau \(Indy Team\) (no.spam@no.spam.com)
Date: Wed, 20 Feb 2008

"Chus GZarco" <jagarcia_cointec_nospam@nospam.hotmail.com> wrote in message
news:9AAFF44E5349E340jagarcia_cointec_nospam@nospam.hotmail.com...

> 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.

Gambit

Replies

None

In response to

How to serve a pdf file and view it inside the explorer posted by Chus GZarco on Wed, 20 Feb 2008