Skip to content
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

Problems with setting viewer.previewUrl #116

Closed
justingit opened this issue Mar 1, 2017 · 7 comments
Closed

Problems with setting viewer.previewUrl #116

justingit opened this issue Mar 1, 2017 · 7 comments

Comments

@justingit
Copy link

justingit commented Mar 1, 2017

I'm trying to use RichFilemanager with CKEditor. I still cannot get RichFilemanager to return the URL of the image I've selected, no matter what I try. Instead, I continue to get the Connector URL.

In my setup, files are to be uploaded in a folder outside of RichFilemanager:

Absolute Server Path:
/home/myaccount/public_html/file_uploads

URL:
http://example.com/file_uploads

RichFileManager is set up at:

Absolute Server Path:
/home/myaccount/public_html/RichFilemanager-2.2.2

URL:
http://example.com/RichFilemanager-2.2.2

I am under the impression that viewer.previewUrl in config.filemanager.config.json will be used if set to a URL of the parent folder, and viewer.absolutePath is set to, true:

"viewer": {
    "absolutePath": true,
    "previewUrl": "http://example.com/file_uploads/",

I have set up, RichFilemanager-2.2.2/connectors/php/config.php with the following:

    "serverRoot" => false,
    "fileRoot" => "/home/myaccount/public_html/file_uploads/",

Selecting a file will still generate a URL like this,

 http://example.com/RichFilemanager-2.2.2/connectors/php/filemanager.php?mode=readfile&path=file.jpg&time=1488412519863

What am I doing incorrect?

@psolom
Copy link
Owner

psolom commented Mar 2, 2017

Your setup is completely correct.
There was a bug that prevented to use absolute path, even when "previewUrl" is set explicitly in combination with your server-side options. I have fixed it at the DEV branch. Check it and post the feedback, please. I will include the bugfix in the next release if it works for you.

@justingit
Copy link
Author

As always, I appreciate your reply. I'll try out the dev. branch and report my findings,

@justingit
Copy link
Author

The changes made in the dev branch make the app behave in a correct way.

One question: why is there a ?time= query string added to the URL of the image?

@psolom
Copy link
Owner

psolom commented Mar 3, 2017

It is used to disable image caching while preview, however it's useless upon selection. I've been going to remove it for a long time. Seems the time has come )

@psolom
Copy link
Owner

psolom commented Mar 3, 2017

Fixed, check it, please.

@justingit
Copy link
Author

justingit commented Mar 9, 2017

Fixed, check it, please.

Yup, that removes the timestamp in the query string.

@psolom psolom added this to the 2.3.0 milestone Mar 11, 2017
@psolom
Copy link
Owner

psolom commented Mar 17, 2017

Fixed in v2.3.0

@psolom psolom closed this as completed Mar 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants