<?php // В PHP 4.1.0 и более ранних версиях следует использовать $HTTP_POST_FILES // вместо $_FILES. $uploaddir = '/var/www/html/uploads/'; $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); echo '<pre>'; /* if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { echo "Файл корректен и был успешно загружен.\n"; } else { echo "Возможная атака с помощью файловой загрузки!\n"; }*/ echo 'Некоторая отладочная информация:'; print_r($_FILES); print "</pre>"; ?> 

find does not find the file

Where is the file?

Variable in php.ini

  upload_tmp_dir no value 

Maybe after setting this variable, the file will actually be in a temporary folder? OR is there any parameter php that automatically "does the cleaning"?


BUT if you uncomment the code (moving to the folder ... uploads) the code will work without errors. The file will be in ... uploads.

links:

upload check upload files

upload strange browser behavior

Is the downloadable file in the temporary folder after the script ends?

Where does the server upload? (there is no file in the temporary folder). upload_tmp_dir

minimum file size for exif_imagetype to work correctly

No drawing is displayed in the browser

    1 answer 1

    Use http://php.net/manual/ru/function.move-uploaded-file.php
    If you do not use this function, the files will be located in the temporary folder and deleted after the completion of the PHP script.

    • "and deleted after the completion of the PHP script." - that is, a special temporary folder should not be cleaned? - root_x Povierennyy
    • Where is it written ??? ru.stackoverflow.com/questions/538033/… - root_x Povierennyy