I’m uploading files via JS and storing the temp path in the session.
Than i use the following code to move the files.
if(move_uploaded_file($_SESSION['temp_img'][$key]['path'], $dest.$bigimg)){
$dest and $bigimg are defined earlier in the script with the id from the database.
Any Ideas or alternatives ?
MANCHUCK’s answer was close but not quite there. You must call
move_uploaded_filewithin the script where the file was uploaded. You cannot do what you’re doing, that is, “storing temp path in the session” because that path is only valid for one request.From the PHP manual:
(Emphasis mine)