Welcome Guest, Not a member yet? Register   Sign In
Problem with move() and file exists (SOLVED)

(This post was last modified: 11-20-2020, 02:28 PM by neoneeco.)

(sorry for my bad english)
I have a problem with the file exists function, after a file move(). This one tells me each time the file does not exist
Cannot then resize an uploaded image, however the image is well saved in the local directory, so the file exists function should output "true"
Does somebody have an idea ? Thanks in advance

French :
J'ai un probleme avec la fonction file exists , après un move() de fichiers. Celle ci m'indique a chaque fois que le fichier n'existe pas
Impossible ensuite de redimensionner une image uploadé , pourtant l'image est bien enregistrée dans le repertoire local, la fonction file exists devrait sortir "true"
Quelqu'un a t-il une idée ? Merce d'avance 

PHP Code:
private function manageFiles($files$id$thumb false) {
= \Config\Database::connect();
        $builderImages   $db->table('images');

        foreach($files['theFile'] as $file) {
            if($file->isValid() && !$file->hasMoved()) {

                $newName $file->getRandomName();
= [
                    'name' => $newName,
                    'galeries_id'  => $id,

                $image_path base_url() . '/uploads/' .$newName;

                if (!file_exists($image_path)) :
                    echo $image_path;
                    echo 'wrong_path';     // ==> Always !!

                if($thumb) {
'"'.base_url() . '/uploads/330x200_' .$newName.'"';
                    $return $this->resize_img($image_path$image_dest$max_size 330$quality 80);
                    echo $return;


Messages In This Thread
Problem with move() and file exists (SOLVED) - by neoneeco - 11-19-2020, 07:27 AM

Theme © iAndrew 2016 - Forum software by © MyBB