-
Notifications
You must be signed in to change notification settings - Fork 720
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
Get relative path without the domain #1233
Comments
I believe this can be accomplished by changing Take javascript integration document as example, the default integration looks like this (notice
By changing how urls are handled, we can remove the domains from image urls:
The reason why domain part is left in the url, is that I think it is simpler to use javascript to remove domain, rather than to append the domain afterward. If Please let me know it this solves your issue. |
This works. Thank you. The issue was solved partially. When i use the file laravel-filemanager with WYSIWYG Editor it includes the domain in the content. Do you have any plan to control this via config? In my case, I am not using this filemanager for a standalone file server. So this is a big problem for me, as it impacts the development of the application in the local and products. |
Understood. Current solution is not valid with WYSIWYG editors. In that case, the following workaround should do the trick: Replace:
With:
The previous workaround for stand-alone button should be discarded with this workaround. Thanks for the notice of these two use cases. New configuration for relative path seems good. Since this package involves both frontend and backend, I will take some time thinking about how to organize the new configuration with older ones. |
Thank you for your response. I will try this new fix. But again changing
the library file is not ideal and I might for. But it will fix the issue
for now.
It would be great if you think about this scenario and try to implement via
the config.
Nasir Khan Saikat
https://nasirkhn.com
…On Sat, Apr 27, 2024, 8:58 PM Stream ***@***.***> wrote:
Understood. Current solution is not valid with WYSIWYG editors.
In that case, the following workaround should do the trick:
Around the line
https://github.com/UniSharp/laravel-filemanager/blob/master/public/js/script.js#L722
of script.js
Replace:
var url = items[0].url;
With:
var url_to_parse = new URL(items[0].url);
var url = file_url.href.substring(file_url.origin.length);
The previous workaround for stand-alone button should be discarded with
this workaround.
Thanks for the notice of these two use cases. New configuration for
relative path seems good. Since this package involves both frontend and
backend, I will take some time thinking about how to organize the new
configuration with older ones.
—
Reply to this email directly, view it on GitHub
<#1233 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADA5OZHSWZIPMP563EWU3DY7O4IJAVCNFSM6AAAAABGQ3777GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBQHA2DKMJWGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I am using the
Standalone button
integration on my project. When I select an image it returns the path.The issue is the file path includes the domain name. My local, staging, and production have different domains, so when I try to use the production database on my local, none of the image paths work.
I believe this is a bug! if this behavior can be changed from the config please let me know. Without a relative path, I will not be able to use this package at all!
Expected Behavior
A relative path will be returned, without the domain name.
Actual Behavior
The package returns a filepath including the domain name.
The text was updated successfully, but these errors were encountered: