Forum Moderators: coopster

Message Too Old, No Replies

Folder for uploads outside root folder

where to place it exactly and path

         

rowtc2

12:56 pm on Oct 1, 2010 (gmt 0)

10+ Year Member



I am working for a website where users can upload images.For security reasons i have read is good to place the folder with uploads outside of root directory,to not execute php scripts or viruses.

I am on my dedicated server.

I understand i must create a folder Uploads not within public_html. Will be parallel with public_html, .htpasswds, mail, public_ftp.This will be a folder outside of root.

It is correct? What path i will display in html code to display images?

Thanks

enigma1

1:49 pm on Oct 1, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is correct?

yes

What path i will display in html code to display images?

A regular url that points to a script which can access the folder load the image and send it to the browser.

eg:
http://example.com/image_decoder.php?image_id=15

So the image_decoder.php script will access the physical path from your server load the file and echo its contents along with an image header.