By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,517 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,517 IT Pros & Developers. It's quick & easy.

Specifying the src attribute on an IMG which is not on the server..

P: n/a
Hello people...

I am unsure if javascript has got to do anything with my problem.. In
fact I am even unsure of a solution to my problem.

What I want to achieve is to pick the image data from the database
rather as a static file on the server. I have a PHP file which
supplies me with the image data from the database.

Effectively, I would want something like

<IMG src='http://myserver.com/GetImage.php?strImageId=img_id_1'/>

GetImage.php is a file which would serve me with the image data from
the database; depending on the 'strImageId' variable.

The above snippet outputs a pile of binary data.... Are there headers
to be inserted?? I really dont know... I am stumped.. I really
appreciate your help, folks..

Regards,
Rithish.
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a


Rithish wrote:
I am unsure if javascript has got to do anything with my problem.. In
fact I am even unsure of a solution to my problem.

What I want to achieve is to pick the image data from the database
rather as a static file on the server. I have a PHP file which
supplies me with the image data from the database.

Effectively, I would want something like

<IMG src='http://myserver.com/GetImage.php?strImageId=img_id_1'/>

GetImage.php is a file which would serve me with the image data from
the database; depending on the 'strImageId' variable.

The above snippet outputs a pile of binary data.... Are there headers
to be inserted??


Well, it is a PHP question, make sure your GetImage.php tells the client
that it sends an image, e.g. for a GIF image
header('Content-Type: image/gif');
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #2

P: n/a
Thanks Martin... Will check that out..

Regards,
Rithish.
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.