phpretard Posted February 15, 2009 Share Posted February 15, 2009 I can't really modify the headers... I would like to display it as an <img src="DBInfo"> tag instead. Is this even possible? The code below displays it fine but I am trying to display it as the website header and it give header errors <? ...connect header("Content-length: $size"); header("Content-type: $type"); header("Content-Disposition: attachment; filename=$name"); echo $content; ?> I would upload it straight to a file but... I have permission to Temp folder problems Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted February 15, 2009 Share Posted February 15, 2009 If you just want to display an image (contained as binary in $content) you can simply do... <?php header('Content-type: image/jpeg'); // or whatever image type it is echo $content; Quote Link to comment Share on other sites More sharing options...
phpretard Posted February 15, 2009 Author Share Posted February 15, 2009 I can't modify the headers without error... Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted February 15, 2009 Share Posted February 15, 2009 Post your code, you cannot output anything before sending headers and you shouldn't need to, you're only outputting the image. Quote Link to comment Share on other sites More sharing options...
phpretard Posted February 15, 2009 Author Share Posted February 15, 2009 Believe me I know about the headers. I think I'll just try to deal with the permissions issue and upload it to a folder. Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.