1

I've now a blob file with an image in it. How can i insert it into a page? Around is some other text & stuff, so I can't set the header to

header("Content-type: image/gif"); 

or something...

thx for help

flo

0

4 Answers 4

1

you would need to serve the image separately and set the header. IE, create another page 'images.php' that will return the image, and then in the page where you want the image just put the images.php?id=uniqueid and the source

Sign up to request clarification or add additional context in comments.

Comments

1

You'll have to output the image in a separate script where you can do the header() call. There are data: URIs that allow embedding images in HTML pages directly but they suck for a multitude of reasons.

1 Comment

en.wikipedia.org/wiki/Data_URI_scheme list some interesting advantages and disadvantages of the data URI scheme. As always, IE plays not nicely...
0

You can either try to embed the image using a data-URI (not supported across all browsers and most probably not practical in terms of page size and client side caching) or create a second script that only sends the blob (using the correct content-type) as an image to the user and embed this blob using a normal <img> tag.

Comments

0

You cannot do this directly. You'll have to make a new PHP script that extracts the blob data from the database, and set the appropriate headers.

However, there is another (browser dependant) way:

Enclose the base64 encoded blob in an tag. More info on this can be found here: http://bit.ly/ex0BSN

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.