Skip to content

Full absolute path to image #199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ppounder opened this issue Dec 11, 2015 · 2 comments
Closed

Full absolute path to image #199

ppounder opened this issue Dec 11, 2015 · 2 comments

Comments

@ppounder
Copy link

Hi there,

Absolutely love the bundle. I'm using this with KNP Snappy Bundle to output some of my content to PDF. This requires the uploaded images to have full absolute path to the image location.

Can you advise how I can prefix my base url to the image location so that when an image is selected it shows the full path not just the path from the webroot.

Example:
I require the path to the image to be: http://localhost/uploads/image.png, at the moment I have it as: /uploads/image.png

This is currently my config:

roots:       # at least one root must be defined
    uploads:
        show_hidden: false # defaults to false
        driver: LocalFileSystem
        path: uploads
        upload_allow: ['image/png', 'image/jpg', 'image/jpeg']
        upload_deny: ['all']
        upload_max_size: 128M

I've tried adding the url: "http://localhost/uploads" and url: "http://localhost/" to the config, but that isn't doing anything, or I'm using it incorrectly. Any help would be appreciated.

Kindest regards
Paul

@helios-ag
Copy link
Owner

Hi @ppounder, you can set "relative_path" option to false, under your instance node, i.e.

fm_elfinder:
   instances:
       default:
           relative_path: false #default true
...

There is also 'path_prefix' option, which you can adjust, if you have your project that isn't configured as vhost (i.e. 127.0.0.1/symfony_project/web/app_dev.php).

@ppounder
Copy link
Author

As simple as that, many thanks :-) 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants