I have created an image upload script and for security reasons the images are placed in a folder outside of the root directory. To obtain the images I reference a php script in as the img src which returns the image using the header function. My question is, is this method slower than directly referencing an image in a directory. If it is slower is this bad from a search engine point of view?
My other option is to place the upload folder within the root however I'm not hosting the site myself and using dreamweaver as my ftp ap I'm unable to set the folder permissions to anything other than 777 (the option is there but doesn't seem to work, I set the folder to 775 and when I check again it has reset itself to 777). Does anyone know of a reliable way to remotely set a folders permissions? Are there any other options.
First time for me on this forum, a recent convert from vbscript to php, thanks in advance.
is there a speed difference?
Moderator: General Moderators
Re: is there a speed difference?
Yes, this is slower than directly accessing the images. However, this is a very common approach to solving the problem of uploading files you don't want the public to be able to access.
As far as SEO goes, it shouldn't even be a consideration. You mention you have security reasons for placing the files outside the document root. I'd imagine those same security reasons would cause you to not want search engines to be able to access the images at all. If they can, then anyone can & there's no reason to store the images outside the document root.
As far as SEO goes, it shouldn't even be a consideration. You mention you have security reasons for placing the files outside the document root. I'd imagine those same security reasons would cause you to not want search engines to be able to access the images at all. If they can, then anyone can & there's no reason to store the images outside the document root.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.