470,601 Members | 1,527 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,601 developers. It's quick & easy.

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

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
2 880


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
Thanks Martin... Will check that out..

Regards,
Rithish.
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Amittai Aviram | last post: by
14 posts views Thread by Del Ferguson | last post: by
reply views Thread by Bruno Jouhier | last post: by
2 posts views Thread by Nathan Sokalski | last post: by
6 posts views Thread by Naveen K Kohli | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.