Immediately code:

if ($_FILES) { $file_name = $_FILES['file']['name']; $file_new_name = time() . '_' . $file_name; echo $file_name . '<br />' . $file_new_name; move_uploaded_file($_FILES['file']['tmp_name'], ROOT_DIR . '/uploads/mee/' . $file_name); rename(ROOT_DIR . '/uploads/mee/' . $file_name, ROOT_DIR . '/uploads/mee/' . $file_new_name); $db->query("INSERT INTO " . PREFIX . "_downloads (id, name, server_name, downloads) VALUES (NULL, '$file_name', '$file_new_name', '0')"); $insert_id = $db->insert_id(); } 


 <form method="post" action="" enctype="multipart/form-data"> <input type="file" name="file" /> <input type="submit" value="Добавить" class="action" /> </form> 

That's where echo $file_name.'<br />'.$file_new_name; - it gives the name of the file and its new name, as it should be => the file is loaded into memory. But then the file does not appear in the right folder. Yesterday, everything seemed to work, but today it suddenly ceased :) Yes, and I didn’t change anything (again, it seems).

What could be the problem?

    1 answer 1

    Problem solved. The file was not loaded due to the upload_max_filesize directive in php.ini