How to access and display the images that are located outside the application folder? Let's say I have a file directory that stores all the images and other file types, and this file directory is located on a different drive then my application folder. For certain file types ( such as .pdf, .doc, I want to prompt the user to download those files).
As far as I know, it's not possible to put absolute path in the <img src
attributes, i.e, img src="D:\\file directory">
doesn't work. And also I want to restrict the access to login user only.
I am using PHP as my server side language.
Note: <img src="file:/// .../>
won't work in Firefox. See here for comments.
Edit: Since only authenticated user can access those images, and since I have an index.php that checks for all the incoming requests, filters off non-authenticated users, I don't think creating an Apache Alias will work.
Here's an example of my conf file:
NameVirtualHost *:80
<VirtualHost *:80 >
ServerName pmmenu.businessjob.net
DocumentRoot "D:\web"
DirectoryIndex index.html index.php
<Directory "D:\web">
AddDefaultCharset UTF-8
Order Deny,Allow
Allow from all
RewriteEngine on
RewriteBase /
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# no, so we redirect to our front web controller
RewriteRule ^(.*)$ index.php [QSA,L]
</Directory>
</VirtualHost>