Hello
I have an index page in my local computer as the following:
http://local.myweb.nz/index.php
This web has DocumentRoot as:
/home/myname/workspace/myweb/html
The index.php is inside html folder
In this index.php, I want to have an image logo called "logo.gif". The problem here is, this image is in totally different folder in the file systems
/home/myname/workspace/files/images/logo.gif
I tried this in the file "index.php"
<img src="/home/myname/workspace/files/images/logo.gif" />
But I cannot see the image ...
How I can fix this problem or it is impossible ...
Many thanks
johnhelen
display image in a different location in file system
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
You could reference the image file with a complete path i.e. http://www.../files/images/logo.gif
It is not true, my compatriot. Displaying files out of the web root could be done by reading the image file with some of the file functions, setting appropriate headers depending on the image type and printing the content of the file. This must be done in separate php file which will be used as SRC attribute of the IMG tag.jmut wrote:Well images,css and all client side stuff should be visible through web root.
In your case simplest I think will be creating symlink within webroot that points to other dir. And allowing apache to follow symlink.
Yes it is true, my compatriot or whatever this ismiro_igov wrote:It is not true, my compatriot. Displaying files out of the web root could be done by reading the image file with some of the file functions, setting appropriate headers depending on the image type and printing the content of the file. This must be done in separate php file which will be used as SRC attribute of the IMG tag.jmut wrote:Well images,css and all client side stuff should be visible through web root.
In your case simplest I think will be creating symlink within webroot that points to other dir. And allowing apache to follow symlink.
Although using script as you suggest is more flexible and could add more functionality. Symlink works and is simple.
I meant
Lack of English
http://dictionary.reference.com/browse/compatriot
is not true.Well images,css and all client side stuff should be visible through web root.
Lack of English
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Which would be both wasteful and impractical. It definitely would work against hotlinking though.miro_igov wrote:It is not true, my compatriot. Displaying files out of the web root could be done by reading the image file with some of the file functions, setting appropriate headers depending on the image type and printing the content of the file. This must be done in separate php file which will be used as SRC attribute of the IMG tag.