A
A
Alexey Nikolaev2019-05-07 15:11:49
Laravel
Alexey Nikolaev, 2019-05-07 15:11:49

Why does the file upload successfully but Laravel considers it an error?

Good day.
There is a simple file upload code. Everything works, but Lara says that "The file "exclude.jpg" was not uploaded due to an unknown error", although this is nonsense and absurdity, because the file is present at the destination. There is a physical movement of downloaded files.

// Сперва берем файл из реквеста, перемещаем его во временную директорию
// Все работает, но ошибка
$filePath = $file->move(
    storage_path('temp'),
    $file->getBasename() . '.' . $file->getClientOriginalExtension()
);

Why? How to fix? Obviously, this is a bug in the Symphony component (which is no wonder, if you look at how it is written). How to get around?

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