I have a PHP script that has worked just fine until recent PHP updates (Arch Linux). And I can’t seem to figure out how to resolve the issue. Here is the relevant portion of the script.
ini_set("log_errors", 1);
ini_set("error_log", "php-error.log");
require_once "Mail.php";
require_once "crypto_new.php";
$target_path = "./";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)){
//stuff
}
It seems to bork up when trying to execute move_uploaded_file
, and it throws the following error.
PHP Notice: Undefined index: uploadedfile in /srv/http/test/receiver.php on line 14
PHP Warning: move_uploaded_file(): Unable to move '/tmp/phppRkyQy' to './0a68457237fcc579c2ec03d69519f021' in /srv/http/test/receiver.php on line 14
Any idea what might be wrong and how to resolve it?