Closed con322 closed 9 years ago
In new version 2.2.0 that has just been released, you have alias @uploads that will target app_root/uploads folder that has been added to template. If you need that solution in you current project you can check new code ( see web.php config file ).
Awesome, how easy is it to update from your old version? What's th best way?
Thanks
Unfortunately it is not possible to do some kind of automatic update for templates. I suggest downloading new version and then copy/paste your existing code there.
Hi it doesnt seem to be working i have asked the question over at stackoverflow if you could reply on there or read on there and reply on here if possible?
Thanks Connor
Inside _protected/common/config/bootstrap.php
there is @appRoot
alias defined. Try experimenting with it. Also have you tried: 'uploadPath' => '@uploads',
?
Where is the @upload defined and does @upload target the uploads folder outside the _protected folder
i get the following error when trying
'uploadPath' => '@uploads',
{"name":"PHP Warning","message":"mkdir(): Permission denied","code":2,"type":"yii\base\ErrorException","file":"/Applications/MAMP/htdocs/legit_check_new/advanced_2/_protected/vendor/pendalf89/yii2-filemanager/models/Mediafile.php","line":132,"stack-trace":["#0 [internal function]: yii\base\ErrorHandler->handleError(2, 'mkdir(): Permis...', '/Applications/M...', 132, Array)","#1 /Applications/MAMP/htdocs/legit_check_new/advanced_2/_protected/vendor/pendalf89/yii2-filemanager/models/Mediafile.php(132): mkdir('//@uploads/2015...', 511, true)","#2 /Applications/MAMP/htdocs/legit_check_new/advanced_2/_protected/vendor/pendalf89/yii2-filemanager/controllers/FileController.php(75): pendalf89\filemanager\models\Mediafile->saveUploadedFile(Array, false)","#3 [internal function]: pendalf89\filemanager\controllers\FileController->actionUpload()","#4 /Applications/MAMP/htdocs/legit_check_new/advanced_2/_protected/vendor/yiisoft/yii2/base/InlineAction.php(55): call_user_func_array(Array, Array)","#5 /Applications/MAMP/htdocs/legit_check_new/advanced_2/_protected/vendor/yiisoft/yii2/base/Controller.php(151): yii\base\InlineAction->runWithParams(Array)","#6 /Applications/MAMP/htdocs/legit_check_new/advanced_2/_protected/vendor/yiisoft/yii2/base/Module.php(455): yii\base\Controller->runAction('upload', Array)","#7 /Applications/MAMP/htdocs/legit_check_new/advanced_2/_protected/vendor/yiisoft/yii2/web/Application.php(84): yii\base\Module->runAction('filemanager/fil...', Array)","#8 /Applications/MAMP/htdocs/legit_check_new/advanced_2/_protected/vendor/yiisoft/yii2/base/Application.php(375): yii\web\Application->handleRequest(Object(yii\web\Request))","#9 /Applications/MAMP/htdocs/legit_check_new/advanced_2/backend/index.php(18): yii\base\Application->run()","#10 {main}"]}
Its in :_protected/common/config/main.php
What alias can I use within module configurations when trying to set the path to outside the _protected folder for example I need to configer it so that I have an uploads folder that is accessible by both public, frontend application and backend.
_protected uploads
Here is my current config which isn't working when trying to upload/retrieve images: