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

  • Do you have such a wwwroot folder? - Kosta B.
  • Advice for all occasions - read carefully the logs and errors - korytoff
  • The folder is C: \ inetpub \ wwwroot \ - AimBot
  • If filename is not an uploaded file, no action is taken and move_uploaded_file () returns FALSE. If filename is a downloaded file but cannot be moved for any reason, no action is taken and move_uploaded_file () returns FALSE. In addition, a warning is displayed. php.net/manual/ru/function.move-uploaded-file.php - TigerTV.ru
  • move_uploaded_file () does not move a file - AimBot

0