Closed Flashtheorie closed 2 years ago
Ok, so I managed to make it work using :
Flight::route('GET /uploadfile/@name', function($name){
$_GET['file'] = $name;
include 'views/assets/img/photos_pre_inscription/';
});
and
move_uploaded_file($_FILES["new_avatar"]["tmp_name"][$i], "uploadfiles" . $nouveauNom);
But it puts the files at the root of my project and with uploadfiles(sha1(name of the file) like :
uploadfiles3f7ddbe448683afb98c8436409456ef5
Not what I want 😄
Ok, I managed by myself by adding the destination into a variable
$destination = "assets/img/photos_pre_inscription/".$nouveauNom;
move_uploaded_file($_FILES["new_avatar"]["tmp_name"][$i],$destination);
Hi everyone, How should I use move_uploaded_file with Flight ? As, when I use the usual :
It's doing a 500