Forum Moderators: coopster

Message Too Old, No Replies

Forbidden File acces problem (help me)

You don't have permission to access "#*$!xx" on this server.

         

bnpla

8:23 pm on Mar 15, 2006 (gmt 0)

10+ Year Member



Hi,
i'm using the move_uploaded_file and when i try to acces the file, i get this:

You don't have permission to access /images/cat.jpg on this server.

What is this? why?

whoisgregg

8:34 pm on Mar 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld [webmasterworld.com], bnpla!

If you are specifying /images/cat.jpg, then you are actually telling the server to place the image in a folder at the root of the hard drive called "images." Instead you probably want to put the image in the /images/ directory inside of your web sites directory.

Try something like:

$_SERVER['DOCUMENT_ROOT'].'/images/'.$name_of_new_image.'.jpg';

You can read more on $_SERVER variables [php.net] in the manual. :)

nfs2

8:43 pm on Mar 15, 2006 (gmt 0)

10+ Year Member



It might me a chmod thing. Try chmod'ding it first

chmod("/somedir/somefile", 755);

bnpla

12:21 am on Mar 16, 2006 (gmt 0)

10+ Year Member



thanks whoisgregg and nfs2!

whoisgregg: Cool tip, i did not know that.

nfs2: i try that and it WORKS FINE! thanks!