yiidoc / yii2-redactor

Extension Redactor WYSIWYG for Yii2 framework
BSD 3-Clause "New" or "Revised" License
186 stars 87 forks source link

Map uploaded files to another path #5

Closed matperez closed 10 years ago

matperez commented 10 years ago

I use a template yii2-advanсed. I need to upload files to the editor on the backend and then use them on the front end with the same reference, so I decided to ship them to a folder in the root of the source code, and then map this directory to the frontend and backend using nginx.

        'redactor' => [
            'class'=>'yii\redactor\RedactorModule',
            'uploadDir'=>'@app/../uploads'
        ],

Now after uploading the image I get these types of links http://backend.advanced.test/home/vhosts/advanced/uploads/1/ae5e0a72b1.20141028202442.jpg

But I need something like this: http://backend.advanced.test/uploads/1/ae5e0a72b1.20141028202442.jpg

Can i somehow map the uploaded image path to the web path set by myself?

zinzinday commented 10 years ago

Yes, on code only support alias @webroot :) with alias @webroot only use for frontend or backend I will fix this issue Thanks this