T
T
themailvnk2017-11-18 23:35:54
Phalcon
themailvnk, 2017-11-18 23:35:54

Why does it return false when trying to move a file?

foreach ($this->request->getUploadedFiles(true) as $file) {
            $file_name = sha1(mt_rand(0, 100) . mt_rand(0, mt_rand(0, 100))) . $file->getName();
            if($file->moveTo($this->config->application->imagesDir . $file_name)){
                $article->preview_img = $file_name;
            }
        }

The file itself is 100% in a temporary folder, I checked it. But nivkakuyu does not want to move to the folder I need. (tried even through the standard php function, the same result)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question