You are here: Problems with header() « PHP « IT news, forums, messages
Problems with header()

Posted by Martνn Marquιs on 06/18/05 00:55

I have to send a PDF file after a submit on a form. The PDF is well created,
and I'm sending it to the client with this:

$fpdfName = "/tmp/" . session_id() . ".pdf";

// Vamos a mandar el PDF
header('Content-type: application/pdf');
// El archivo se va a llamar libreDeuda.pdf
header('Content-Disposition: attachment; filename="libreDeuda' .
'.pdf"');
// El PDF fuente va a ser $ftexName.
readfile($fpdfName);

The problem is that the PDF file that is sent is corrupted for acroread (xpdf
reads it like a charme), because, after the end of file (%%EOF) of PDF there
is an HTML page add to the file.

Is there anyway I can solve this? Is the sintaxis I used for sending a file
correct?

--
18:49:09 up 11 days, 6:35, 1 user, load average: 1.14, 1.26, 1.19
-----------------------------------------------------------------
MartΓ­n MarquΓ©s | select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica | DBA, Programador, Administrador
Universidad Nacional
del Litoral
-----------------------------------------------------------------

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация