Trouble sending an image's contents as output using header Content-Type...

This is a discussion on Trouble sending an image's contents as output using header Content-Type... within the PHP General forums, part of the PHP Programming Forums category; Hi all: I have a page with a img tag: <img src="/getthumbnail.php?fileid=12230983"> ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-10-2003
Manuel VáZquez Acosta
 
Posts: n/a
Default Trouble sending an image's contents as output using header Content-Type...

Hi all:

I have a page with a img tag:
<img src="/getthumbnail.php?fileid=12230983">

The script getthumbnail.php searchs for a thumbnail of the specified image
id; if not thumbnail exists, the script creates one; and then using
readfile() and header() functions flushes it contents to the browser. But it
fails.

The code is very simple:

header('Content-Type: image/jpeg'); // I'm testing with JPEGs

// If the thumbnails exists (or it gets generated this time)
if ($path = _generateThumbnail($_GET['fileid']))
@readfile($path);
else
@readfile(GENERIC_THUMBNAIL); // A constant to a generic icon



Any tips?
Manu.
Reply With Quote
  #2 (permalink)  
Old 11-10-2003
Marek Kilimajer
 
Posts: n/a
Default Re: [PHP] Trouble sending an image's contents as output using headerContent-Type...

Manuel Vázquez Acosta wrote:
> Hi all:
>
> I have a page with a img tag:
> <img src="/getthumbnail.php?fileid=12230983">
> Any tips?
> Manu.
>


Type http://server.com/getthumbnail.php?fileid=12230983 in the location
bar and see what happens.
Reply With Quote
  #3 (permalink)  
Old 11-10-2003
Manuel VáZquez Acosta
 
Posts: n/a
Default Re: [PHP] Trouble sending an image's contents as output using header Content-Type...

> Type http://server.com/getthumbnail.php?fileid=12230983 in the location
> bar and see what happens.


I have already done it; it didn't work.

Manu.
Reply With Quote
  #4 (permalink)  
Old 11-10-2003
Marek Kilimajer
 
Posts: n/a
Default Re: [PHP] Trouble sending an image's contents as output using headerContent-Type...

Manuel Vázquez Acosta wrote:
>>Type http://server.com/getthumbnail.php?fileid=12230983 in the location
>>bar and see what happens.

>
>
> I have already done it; it didn't work.
>
> Manu.
>

Did you see any error? If not, do you have display_errors set to on?
Reply With Quote
  #5 (permalink)  
Old 11-10-2003
Manuel VáZquez Acosta
 
Posts: n/a
Default Re: [PHP] Trouble sending an image's contents as output using header Content-Type...


"Marek Kilimajer" <kilimajer@webglobe.sk> wrote in message
news:3FB00C2B.6010708@webglobe.sk...
> Manuel Vázquez Acosta wrote:
> >>Type http://server.com/getthumbnail.php?fileid=12230983 in the location
> >>bar and see what happens.

> >
> >
> > I have already done it; it didn't work.
> >
> > Manu.
> >

> Did you see any error? If not, do you have display_errors set to on?



I have a log file and nothing is logged; my error_reporting setting is to
E_ALL; but now that you metion it I call some functions with an appending @;
I will check this.

Manu.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:53 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0