l3rodey Posted June 26, 2013 Share Posted June 26, 2013 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? Quote Link to comment Share on other sites More sharing options...
boompa Posted June 26, 2013 Share Posted June 26, 2013 $HTTP_POST_FILES Can't help with IIS issues, but I just wanted to say that based on your use of the above whatever tutorial you are following is *old*. Consider reading the actual PHP documentation on handling file uploads. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted June 26, 2013 Share Posted June 26, 2013 You haven't defined $url for the test you are doing midway. Also - what is 'none'? Not a string;not a var. So I think the test of "$url != none" always fails and hence no copy-ing occurs. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.