HighDots Forums  

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

Javascript JavaScript language (comp.lang.javascript)


Discuss Specifying the src attribute on an IMG which is not on the server.. in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rithish
 
Posts: n/a

Default Specifying the src attribute on an IMG which is not on the server.. - 05-10-2004 , 10:19 AM






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.

Reply With Quote
  #2  
Old   
Martin Honnen
 
Posts: n/a

Default Re: Specifying the src attribute on an IMG which is not on the server.. - 05-10-2004 , 10:33 AM








Rithish wrote:

Quote:
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/



Reply With Quote
  #3  
Old   
Rithish
 
Posts: n/a

Default Re: Specifying the src attribute on an IMG which is not on the server.. - 05-11-2004 , 12:33 AM



Thanks Martin... Will check that out..

Regards,
Rithish.

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 On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.