Move Uploaded file Permission Problem

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
danrah
Forum Newbie
Posts: 8
Joined: Sun Dec 03, 2006 7:13 am

Move Uploaded file Permission Problem

Post by danrah »

I upload my files correctly( error code is 0 )
but when i want to move uploaded files using move_uploaded_file :
$uploaded=move_uploaded_file($_FILES['image']['tmp_name'],"pics");
the following error occurs:
failed to open stream: Permission denied
i am using windows so i checked the folder and unsetted read-only but the problem still persists.
what should i do?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Which one had permission denied?

Is "pics" a directory? You need to give a filename in the destination too.
danrah
Forum Newbie
Posts: 8
Joined: Sun Dec 03, 2006 7:13 am

Post by danrah »

yes it is a directory
am i using move_uploaded_file correctly?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

danrah wrote:yes it is a directory
am i using move_uploaded_file correctly?
Outside of the previously noted "you need to give a filename in the destination too," yes.
User avatar
ok
Forum Contributor
Posts: 393
Joined: Wed May 31, 2006 9:20 am
Location: The Holy Land

Post by ok »

Post the part of the script handling the upload.
Post Reply