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:  Chus GZarco (jagarcia_cointec_nospam@nospam.hotmail.com)
Date: Wed, 20 Feb 2008

Chus GZarco wrote:

> I have a little httpserver that serves reports in pdf format.
>
> 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.
>
> Thanks.
>
> The request is http://localhost:8000/informe?idpeticion=6427
>
> the server create an pdf document and send it to the client.
>
> AResponseInfo.ResponseNo  := 200;
> AResponseInfo.ContentText := ExtractFileName( ArchivoInforme );
> AResponseInfo.ContentType := MIMEMap.GetFileMIMEType( ArchivoInforme
> ); ByteEnviados              := AResponseInfo.ServeFile( AContext,
> ArchivoInforme );

May be a Bug. I have downloaded indy demos and used basic http server.
If i use the compiled version then the file is downloaded inside
explorer, but if i compile the protect and run it, then the
explorer/firefox shows me the dialog to open-save-cancel.

I use indy 10.2.3

--

Replies

In response to

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