Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's wrong with move_upload_file

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
if (is_uploaded_file($userfile)) {
$tmp_file = get_cfg_var('upload_tmp_dir') ;
$ok=true;
copy($userfile, $tmp_file."\\".$userfile_name);
if (is_uploaded_file($userfile))
move_uploaded_file($userfile, $directory);
}

Warning: Unable to create '': Permission denied in c:\program files\apache group\apache\htdocs\pss\inc\upload.html on line 21

Warning: Unable to move 'c:\Program Files\Apache Group\Apache\htdocs\php19.tmp' to '' in c:\program files\apache group\apache\htdocs\pss\inc\upload.html on line 21

$directory is an alias directory put in the apache dir with the right permissions!!!
 
I'm getting exactly that problem (not sure about the permissions tho). I eagerly await some hints about this problem! [bigglasses]
 
I use this for uploading:
[tt]
$file = $_FILES['userfile']['name'];
$temp = $_FILES['userfile']['tmp_name'];

if(!empty($file))
{
move_uploaded_file($temp,"../directory/".$file);
}
[/tt]

Works perfectly in PHP4.1+....

Don't eat yellow snow!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top