artgris / FileManagerBundle

FileManager is a simple Multilingual File Manager Bundle for Symfony
MIT License
171 stars 89 forks source link

Incorrect bugged image path when using /assets as upload path #78

Open Joshuab1997 opened 3 years ago

Joshuab1997 commented 3 years ago

Hi,

Recently in our project, we changed the way our images are uploaded. Previously, we uploaded it in /public/img, which didn't cause any problems. Now, we try to upload images in /assets/img/website, but this causes a big issue.

First of all, this is how the config we use looks like:

default: dir: "../assets/img/website" type: image

However, when I try to upload a file, the following happens:

image

Our path is incorrect as it should be /img/website (or at least /assets/img/website) instead of /manager/file, and the questionmark shouldn't be there.

I've tried the demo bundle and it has the exact same issue. This issue only occurs when using assets instead of public, but we have to save images in our assets since they shouldn't be available through filename directly.

artgris commented 3 years ago

Hi, your configuration folder is not in the "public" folder so it has no public access (via /assets/img/website/randomimg.jpg url), filemanager then uses access to private files (with /manager/file/..?conf=default url to access it)

if you want /assets/img/website/randomimg.jpg url, put your assets folder in public and used "../public/assets/img/website" as conf

Joshuab1997 commented 3 years ago

Oh okay, I see, the thing is all the images that are uploaded shouldn't be directly possible. Doesn't the uploading happen in PHP and shouldn't PHP have access to the assets folder? Not sure how it works though so just wondering.