I have a problem running a script to upload a GIF image on my server. I'm using Windows Server 2012 and IIS 8. I tried in all the ways that I found on internet but it is still not working.
In my php.ini the upload temp. dir. is "C:\Windows\Temp" which has the full control permission. Is the same even for the final destination that you can see in this script:
if(isset($_POST['uploadform'])){
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["userfile"]["name"]);
$nomefile = $_FILES["userfile"]["name"];
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
print_r($_FILES);
// Check file size
if ($_FILES["userfile"]["size"] > 15000000) {
echo "Too big.";
$uploadOk = 0;
}
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0)
echo "Sorry, your file was not uploaded.";
else // if everything is ok, try to upload file
if (move_uploaded_file($_FILES["userfile"]["tmp_name"], $target_file))
header("LOCATION: ". WEB ."/ok.php");
}
I have nothing with this code. In the php.ini the file uploading is enabled but nothing appears. Could you help me?
Thanks a lot!