Re: trying to download birary data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If you use a text editor to look at your PDF, you will see this on the
first line:

id is 45%PDF-1.4^[34m^M%âãÏÓ^[34m^M


The debug output "id is 45" is not going to make any PDF reader/viewer
happy, in a big way.

I dunno what else might be wrong, but that's gotta get fixed first and
foremost.

On Sun, April 30, 2006 10:31 am, Ross wrote:
> On this page
> http://www.nationalservicesscotland.com/publications/a-z.php
>
> I use the following code to donwload binary data. It is jsut
> gibberish. I
> think the offending line is echo "<a class=\"pdflinks\"
> href=\"$link\"</a>$name</span>";
>
> How do I recompile the binaryy data into docs and pdfs?
>
>
>          <?
>     $letter="a";
> $query= "SELECT * FROM publications WHERE alphabet='$letter'";
>
>  $result= mysql_query($query);
>    while  ($row = @mysql_fetch_array($result, MYSQL_ASSOC)){
>
>     $row['pdf_size'] = $row['pdf_size']/ 1024;
>  $row['pdf_size']= number_format($row['pdf_size'], 0);
>  $size= $row['pdf_size'];
> $name = str_replace("_", " ", $row['pdf_name']);
> $name = str_replace(".pdf", "", $name);
> $link= $row['content'];
>
> echo "<a class=\"pdflinks\" href=\"$link\"</a>$name</span>";
> echo "&nbsp;&nbsp;";
> echo "<span class=\"sizes\">($size kb)</span>";
> ?><a href="a-z.php?id=<?=$row['id'];?>">link</a> <br>
>
>
> <?
> }
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux