Content index.php
<?php print_r($_FILES); ini_set('upload_max_filesize', '1M'); $date = date('dmY_H:i:s'); $file = __DIR__ . DIRECTORY_SEPARATOR . "upl" . DIRECTORY_SEPARATOR . $date . "_" . $_FILES["inputfile"]["name"]; $tmp = $_FILES["inputfile"]["tmp_name"]; echo $file . "<br>"; echo $tmp; if(move_uploaded_file($tmp, $file)) { echo "Work"; } ?> <html> <head> <title>Secure File Upload</title> </head> <body> <h1>Secure File Upload</h1> <form method="post" action="index.php" enctype="multipart/form-data"> <label for="inputfile">Upload File</label> <input type="file" id="inputfile" name="inputfile"></br> <input type="submit" value="Click To Upload"> </form> </body> </html> Writes in the logs:
[12-May-2018 22:28:00 Asia / Kuwait] PHP Warning : move_uploaded_file (): Unable to move 'C: \ Upload \ php89F0.tmp' to 'C: \ inetpub \ wwwroot \ file \ upl \ test. jpg 'in C: \ inetpub \ wwwroot \ file \ index.php on line 9
wwwrootfolder? - Kosta B.