Home  |  Linux  | Mysql  | PHP  | XML
From:elk dolk Date:Thu Feb  4 19:39:35 2010
Subject:Storing Images #2
On 3 February 2010 16:07,   wrote:

> I currently have all my images referenced by url in my database and stored
> in a folder/s and I think I will keep it that way...

..............................................................

>If you put the images OUTSIDE of the webroot/docroot/public_html
folder (whatever you have), then a user cannot directly navigate to
the file.

e.g.
         /home/sites/your_site/public_html/images/image1.jpg

         http://www.yoursite.com/images/image1.jpg would probably work.

But ...

/home/sites/your_site/public_html/getImage.php
/home/sites/your_site/hidden_images/image1.jpg

>Now, there is no way I can load image1.jpg from my browser. I have to
use getImage.php, which I assume would require me to login or
authenticate myself in some way.
----------------------------------------------------------
I have my photos in /public_html/img/gid directory and with this path:
<img src='http://www.mydomain.com/img/{$gid}/{$photoFileName}' in getImage.php the server displays the photos.

Now if I put my photos outside of the public_html like this: 

/hidden_images/img/gid

what would be the correct path to the photos in the getImage.php script?





      
Navigate in group php.db at sever news.php.net
Previous Next


Your recent visits
Re: [PHP-DB] Storing images
RE: [PHP-WIN] What about php 5.3 and printers or PHP_PRINTER.DLL ?
Re: Storing a file from a cgi parameter
sharing PHP sessions between web servers using NFS


  
© No Copyright
You are free to use Anything
Site Maintained by Zareef Ahmed
Powered By PHP Consultants