M
M
Maxim2016-03-28 09:19:07
Yii
Maxim, 2016-03-28 09:19:07

Yii2 kcfinder. How to upload files in frontend?

Hello!
There is a project with Yii2, an advanced template. Installed ckeditor and kcfinder via composer. The problem appears when uploading files via kcfinder. You need to upload files to /frontend/web/upload, however, when uploading an error: "You do not have permission to upload files." The rights to the upload directory and its child directories 777, on the frontend, are also set to 777.
In the course of many experiments with paths, the following is written in the kcfinder config:
'disabled' => false,
'uploadURL' => "upload",
'uploadDir ' => "../../../../frontend/web/upload",
The upload directory is created, along the path indicated above, you can view the files that are located in it, but you can't upload it. Also, when adding an already existing file, via kcfinder, it will have the path /admin/upload/files/fff.txt, which is also bad, because files will not be visible in ckfinder'e.
A similar question was asked on stackoverflow ( stackoverflow.com/questions/32202966/yii2-kcfinder... where the problem was solved using symlinks.
Is there any other way? If you have already solved a similar problem, please share the kcfinder config 'a.

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