We help IT Professionals succeed at work.

HTTP upload - cannot MOVE file  (IIS/PHP)

jtjli
jtjli asked
on
387 Views
Last Modified: 2010-05-18
I'm with IIS. I am handling form upload using PHP.

After upload, the following line gives me Permission denied.
$movesuccess = move_uploaded_file($_FILES['myfile']['tmp_name'],"a.zip");  // LINE 1

I have tried with PEAR... same:
$movesuccess = $taskfileobj->moveTo("./");  // LINE 2
This will give me an error saying Impossible to move file...

I have set the permissions in my IIS to allow Write already.. i don't know why.

For "LINE 1", I have presumed the directory for a.zip is the current directory -- which is the directory where i am running the script. Am I correct?
Comment
Watch Question

CERTIFIED EXPERT

Commented:
have u given read and also write permission to the folder where ur moving the uploaded files ?
did u restart the server after changing the permissions ?

is a.zip ur directory name ??u need to specify that..once ur file is uploaded ,assuming thats a.zip, it is refrenced as
$_FILES['myfile']['tmp_name']
if(move_uploaded_file($_FILES['myfile']['tmp_name'], $dest)) print "File uploaded!"; else print "File failed to upload.";

CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.