Upload Script error!

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
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Upload Script error!

Post by William »

I have a PHP Script to upload a image. Well For some reason it gives this error:
Warning: move_uploaded_file(19_09.JPG): failed to open stream: Permission denied in
No matter what .jpg I try to upload no matter if it is caps or not it gives that error. I have tried diffrent file names to make sure its not over writing I have chmod the folder to 777 I used mkdir() to make a folder nothing is working. Any ideas?
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Have you tried umask or chorn
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Post by William »

Code: Select all

$old = umask(0);
chmod($uploaddir, 0755) or die("Didn't work!");
umask($old);
Doesn't seem to be helping it at all let me try the other one.
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Post by William »

Warning: chown(): Operation not permitted in
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Are you using a shared host? Some hosts disable PHP from writing files.
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Post by William »

Yeah it is :(
Post Reply