Jump to content

copy() not working


l3rodey

Recommended Posts

Hey all, I have this code:

<?php
$ip = $_SERVER['REMOTE_ADDR'];
$ip = str_replace(".", "", $ip);

if(!is_dir("upload/$ip/")){
mkdir("upload/$ip");
}

$path= "upload/$ip/".$HTTP_POST_FILES['upl']['name'];

if($upl !=none){
if(copy($_FILES['upl']['tmp_name'], $path)){
echo '{"status":"success"}';
}
else { echo '{"status":"success"}'; }
}

echo $ip;
?>
 
Now for notes, this is upload.php and the data is collected from index.php where the upload form is. 
A couple notes from here:
1. this script + index.php work perfect on apache.
2. I am trying to get this only iis7 on server 2008.
3. $ip does create the folder upload/$ip works the folder is created.
 
But the file itself does not appear like I said this works perfect on a shared host with apache not on my private web server.... I don't know if this is correct but on inetpub I have given the user "everyone" full access so there should be no security unless I am doing it wrong...
 
Any suggestions? 
Link to comment
https://forums.phpfreaks.com/topic/279589-copy-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.