-
Notifications
You must be signed in to change notification settings - Fork 88
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
Images routes #26
Comments
I'm currently using Symfony 3.1 and I was facing the same issue. I thought a function was already coded to retrieve this url but it seems not. I checked directly in the template using the There is only a function (bellow) allowing to redirect URLs of the type FileManagerBundle/Controller/ManagerController.php Lines 287 to 301 in 4e35c8d
So, I added the following attribute in $this->websiteUrl = str_replace('\\', '/', $this->getProtocol().$_SERVER['HTTP_HOST'].str_replace($_SERVER['DOCUMENT_ROOT'], '', $file)); And the following method: /**
* Return the current protocol used by the website
* @return string return "http" or "https"
* Source: https://stackoverflow.com/a/14270161/8219923
*/
private function getProtocol(){
if (isset($_SERVER['HTTPS']) &&
($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||
isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
$protocol = 'https://';
}
else {
$protocol = 'http://';
}
return $protocol;
} I don't know if a Pull Request is useful. What do you think about that @artgris? |
I upgraded my project to S4 to use the bundle, buts this look fine to use on S3 |
Hi @Telous, replace your dir path with a relative path:
"../web" or "../public" are required to get 'public' image urls in filemanager. |
Thx @baudev but binaryFileResponseAction is only used to obtain "private" images, when they are not in the web|public dir and not accessible by url. if you remove".../web/", filemanage thinks it's a private directory |
Thanks @artgris, I will try it. |
I used this, but it generates an error: dir not found. Anyway, I updated the project to Symfony 4 and now it works fine. Thank you anyway |
I try to use the bundle on a symfony 3.4 proyect, but when select an image to set i get the follow path:
/admin/manager/file/banner-5bc11d687d8ae.jpeg?module=1&conf=default&route=%5Cbanner
,instead of
img/uploads/banners/banner-5bc11d687d8ae.jpeg
config.yml
I use a symfony buil-in-server to test.
i use this bundle on a symfony 4 proyect and no have any problems.
The text was updated successfully, but these errors were encountered: