|
Posted by Captain Paralytic on 10/19/07 11:22
On 19 Oct, 12:07, "salonowiec" <debrza_removet...@poczta.onet.pl>
wrote:
> My very basic code is:
> <?php
> $fname='alpha.ext';
> readfile($fname);
> ?>
> Only when ext is txt I'm getting a reasonable content, otherwise there's a
> lot of bush. What function should I use to open doc, xls, pdf, gif?...
> Can you help to a supernewbie???
This has nothing to do with the extension. It is the contents of the
files.
If you renamed alpha.ext to alpha.doc, the output would still be the
same.
In general, a .doc file will be written by Microsoft Word in its
custom format, similarly for all the other files.
A .gif file is a binary representation of an image. If you send the
correct headers, then the results of the readfile with a .gif file
would be an image on your browser.
[Back to original message]
|