Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.