Image doesn't show (rhtml path?)


#1

Hi,

we try to show an image which is not inside the rails
framework, and we are not able to see the image!!!
does someone know how to do this???

our rails is installed on

/opt/rails/project1/, so inside “project1” we have all
the rails directory like “app”, “public”, etc.)

our image is on the “/usr/images/”

so in our link on the rhtml. we use a link like:

, however, we
were never able to see the image!!!

but when we put the image inside the rails framework,
we is able to see the image??

Why we are not able to link image outside of the rails
framework???

Thanks youv very much

Saiho

The mind is its own place, and in itself.
Can make a Heaven of Hell, a Hell of Heaven.

http://www.geocities.com/sayoyo/


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


#2

Saiho ~

The user that runs the webserver does not have permission to access
that file, it would be a huge security hole if it could. You need to
have images in public/images.

~ Ben

On 3/16/06, Saiho Y. removed_email_address@domain.invalid wrote:

Why we are not able to link image outside of the rails


Ben R.
http://www.benr75.com


#3

If the security is not a problem(the folder contains
only images) so can I simply change the the folder
right?

— Ben R. removed_email_address@domain.invalid wrote:

On 3/16/06, Saiho Y. removed_email_address@domain.invalid wrote:

/opt/rails/project1/, so inside “project1” we have

Saiho
Tired of spam? Yahoo! Mail has the best spam

Ben R.
http://www.benr75.com


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

The mind is its own place, and in itself.
Can make a Heaven of Hell, a Hell of Heaven.

http://www.geocities.com/sayoyo/


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


#4

If you’re running this under a webserver (apache or lighty), you can
configure a directory
in the file system to be available under a certain path for a given
host. Look at the docs
for your server to see how to do that.

But putting a filesystem path in an html img tag is never gonna work…
and it shouldn’t.
That would be a terrible security hole to just be able to enter any file
path into an html
tag.

b