is there a speed difference?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rsdesigner
Forum Newbie
Posts: 1
Joined: Thu Apr 22, 2010 4:15 am

is there a speed difference?

Post by rsdesigner »

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.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: is there a speed difference?

Post by pickle »

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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply