|
Posted by Andy Hassall on 06/07/05 00:51
On 6 Jun 2005 13:18:19 -0700, "theonlydrayk@gmail.com" <theonlydrayk@gmail.com>
wrote:
><?php
> include('dbinfo.inc.php');
>
> mysql_connect($localhost,$username,$password);
> @mysql_select_db($database) or die( "Unable to select database");
> $query = "SELECT file,filesize,filetype FROM user WHERE id=1;";
> $result=mysql_query($query);
> mysql_close();
>
> $file=mysql_result($result,0,"file");
> $filesize=mysql_result($result,0,"filesize");
> $filetype=mysql_result($result,0,"filetype");
>
> header('Content-Type: '.$filetype);
> print $file;
>?>
>
>it's don't work, firefox gave me "The image
>http://ip:8080/viewimage.php
>cannot be displayed, because it contains error."
>IE show me nothing at all.
>
>any one have a idea ?
One trick to debugging dynamic generation of images is to add in a
header("Content-type: text/plain"), so you can see the output.
A common error is that there is blank space, or even an error or warning
message produced, which the browser then tries (and fails) to interpret as
image data. When displayed as text you can see this.
--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Navigation:
[Reply to this message]
|