Hi

I am in some trouble w.r.t accessing an image on local.

I have a drupal setup on local. The images location being C:\apache2triad\htdocs\drupal-5\files\images\abc.jpg. I want to access the image and place it in a block (created using 'Views' module) that I have placed in a panel.

I have tried options like

<img src="drupal-5\files\images\abc.jpg"> 
<img src="http://localhost/drupal-5/files/images/abc.jpg"> 
<img src="files/images/abc.jpg"> 
<img src="/files/images/abc.jpg">

Please help.

Regards

Comments

ms1’s picture

I have tried options like

<img src="drupal-5\files\images\abc.jpg"> 
<img src="http://localhost/drupal-5/files/images/abc.jpg"> 
<img src="files/images/abc.jpg"> 
<img src="/files/images/abc.jpg">
tm’s picture

assuming img tag is enabled, try <img src="/drupal-5/files/images/abc.jpg">. if you are using the "private" file system, it becomes <img src="/drupal-5/system/files/images/abc.jpg">.

i think(!)

krisna123’s picture

i think u can't display the img because u not use full html input format.
use full html input format/php input format for displaying the img

to see where u must point the src maybe u want to browse first on your browser
maybe like http://localhost/drupal-5/files/images/abc.jpg
if that works then put it on src

if u want dinamic then omited the http://localhost

ms1’s picture

Thanks Krisna and Todd. It was about me not enabling full-html for the post. Hence 'img' tag was not rendered. Once I did that it worked smoothly.

Regards

tm’s picture

now that the pressure is off, try adding the img tag to the filtered html input format and see if that works for you. if so, you should use that input format.

unless you are the only contributor, and then to save you from yourself. it's a cya thing.

ms1’s picture

I tried it with filtered-html but the 'img' tag did not wok with it. But the good part is that I am the only one who would require this facility and not my users. Hence its fine.

Thanks & Regards

drupalnesia’s picture

try enter this line on browser url:
http://localhost/drupal-5/files/images/abc.jpg

can u see the image?

ms1’s picture

Yes, I can view the image by following the url.

vm’s picture

what tm was trying to convey is that you can add the <img> tag to your filtered HTML filter. which can be done by going to administer -> input formats -> configure next to the FILTERED HTML format, then on the configure tab, now you can add whatever tags you want to FILTERED HTML filter and they won't be stripped.
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

ms1’s picture

Oh! I got it this time. Thank you Kenn and Todd.

Regards

garzan’s picture

I tried your suggestion and added in the <img> tag to the filtered html list. When I click on input format, I do see <img> listed, but my images don't display unless I go to full html. I also tried it with <img src> but that didn't work either.

The line I'm using on the page is:

<img src="/files/sdm/esdm_5b.png" alt="GGW HSA" title="River Gages and River Data points in Glasgow's HSA" />

which must be correct, since it does display in full html. I'd really like NOT to use full html though.

Gar

tm’s picture

try leaving the trailing " /" out... technically not correct in xhtml, i know.