artgris / filemanagerbundle Goto Github PK
View Code? Open in Web Editor NEWFileManager is a simple Multilingual File Manager Bundle for Symfony
License: MIT License
FileManager is a simple Multilingual File Manager Bundle for Symfony
License: MIT License
Hello,
Your filemanagerbundle was exactly what I needed. I would have one suggestion/question though; would it be possible to display a progressbar when files are being uploaded? This would be really helpfull to see what is happening for the user. Thanks a lot for the great work.
Hi,
I use SF4 and easyadmin, I override AdminController to add the image field but I see an error
An exception has been thrown during the rendering of a template ("The conf was not found in artgris_file_manager.") in "@ArtgrisMedia/form/field_media.html.twig".
Someone can help me ?
protected function createMediaEntityFormBuilder($entity, $view)
{
$formBuilder = parent::createEntityFormBuilder($entity, $view);
$formBuilder->add('image', MediaType::class)
// ->add('imageCollection', MediaCollectionType::class)
;
return $formBuilder;
}
When i make a dump in Artgris\Bundle\MediaBundle\Form\Type\MediaType.php i find conf var => false
public function buildView(FormView $view, FormInterface $form, array $options)
{
parent::buildView($view, $form, $options);
// dump($options);die;
$view->vars = array_replace($view->vars, [
'conf' => $options['conf'],
'tree' => $options['tree'],
'allow_alt' => $options['allow_alt'],
'allow_crop' => $options['allow_crop'],
'crop_options' => $options['crop_options'],
'display_file_manager' => $options['display_file_manager'],
]);
}
thanks
Hi,
i follow this example:
https://github.com/artgris/FileManagerBundle/blob/master/Resources/doc/tutorials/input-button.md
This work fine, but the value of img contains some parameters.
Example:
/images/manager/file/test.png?module=1&conf=button
How can remove the parameters of the img url?
example:
/images/manager/file/test.png
Is there a possible way to hide folders from specific users?
We have a hierarchy which contains folders for every user. If a user tries to access a foreign folder a AccessDeniedException is thrown but we would like to hide all the folders, not owned by a user.
A hook for access-checks or something similar would be useful.
Hello,
My project have a folder with around of 400 000 images in other 20 folder filled with images. When I try to open the "Media Manager" it takes around of 5 minutes to load the page [and my mac goes crazy ].
I saw that the tool supports lazy loading but even with lazy loading 400 000 seems to be too much for it.
Is there any setting that I am missing? Please advice?
Thank you very much for this tool.
I wanted my humble contribution to the project.
I did the translation into Portuguese from Brazil.
Can I pull a request?
Hello @artgris,
I have an error in my project with your Bundle :
I have the same files and folder as in production but in production it's working.
Any ideas ?
Thanks
I have a Symfony 4 project where I use FOSCKEditorBundle in combination with FileManager. This might be interesting to add to the project?
In manager.js
, under line 153, I added:
// Module CKEditor
if (moduleName === 'ckeditor') {
$('#form-multiple-delete').on('click', '.select', function () {
var url = new URL(window.location.href);
var funcNum = url.searchParams.get("CKEditorFuncNum");
var fileUrl = $(this).attr("data-path");
window.opener.CKEDITOR.tools.callFunction(funcNum, fileUrl);
window.close();
});
}
Example ckeditor config:
fos_ck_editor:
default_config: basic_config
configs:
basic_config:
toolbar: basic_toolbar
advanced_config:
toolbar: advanced_toolbar
filebrowserBrowseRoute: file_manager
filebrowserBrowseRouteParameters:
conf: files
module: ckeditor
filebrowserImageBrowseRoute: file_manager
filebrowserImageBrowseRouteParameters:
conf: images
module: ckeditor
Hi,
it would be great if you managed to implement an optional functionality to remove accents of character from file and folder names when uploading/creating and renaming them.
Most likely is is not an issues in the English, but for example in the Czech language where we use characters like ěščřžýáíéúůňťďĚŠČŘŽÝÁÍÉÚŮŇŤĎ there are problems with file/folder names.
Unfortunately iconv('UTF-8', 'ASCII//TRANSLIT', ...)
does not work properly in every case.
Here are links of some code examples that do handle accents:
Hi,
I'd like to use the bundle for a multi-user application. I'd like to keep the actual director folder name as something immutable, such as a user UUID number, but display the directory folder as the user name .
There are several means of accomplishing this, and I would be happy to do a pull request with changes.
I'm wondering if you have a preferred method?
Regards,
Mark
Hello,
I try to use the file manager and i have an error with my config.yml,
I have this configuration :
artgris_file_manager:
web_dir: web # set your public Directory (not required, default value: web)
conf:
default:
dir: '%kernel.project_dir%/web/uploads'
service: 'file_type_service'
And when i'll try to open manager in form view i have this error :
Please define a "dir" or a "service" parameter in your config.yml
How can i fix this ?
Hey,
This bundle is exactly what I need but when I try to install it on Symfony 4.4, it raises some compatibility error with twig/twig v3.0.3
:
Conclusion: don't install artgris/filemanager-bundle 1.6.4|remove twig/twig v3.0.3|install twig/twig v1.20.0|install twig/
twig v1.21.0|install twig/twig v1.21.1|install twig/twig v1.21.2|install twig/twig v1.22.0|install twig/twig v1.22.1|install twi
g/twig v1.22.2|install twig/twig v1.22.3|install twig/twig v1.23.0|install twig/twig v1.23.1|install twig/twig v1.23.2|install t
wig/twig v1.23.3|install twig/twig v1.24.0|install twig/twig v1.24.1|install twig/twig v1.24.2|install twig/twig v1.25.0|install
twig/twig v1.26.0|install twig/twig v1.26.1|install twig/twig v1.27.0|install twig/twig v1.28.0|install twig/twig v1.28.1|insta
ll twig/twig v1.28.2|install twig/twig v1.29.0|install twig/twig v1.30.0|install twig/twig v1.31.0|install twig/twig v1.32.0|ins
tall twig/twig v1.33.0|install twig/twig v1.33.1|install twig/twig v1.33.2|install twig/twig v1.34.0|install twig/twig v1.34.1|i
nstall twig/twig v1.34.2|install twig/twig v1.34.3|install twig/twig v1.34.4|install twig/twig v1.35.0|install twig/twig v1.35.1
|install twig/twig v1.35.2|install twig/twig v1.35.3|install twig/twig v1.35.4|install twig/twig v1.36.0|install twig/twig v1.37
.0|install twig/twig v1.37.1|install twig/twig v1.38.0|install twig/twig v1.38.1|install twig/twig v1.38.2|install twig/twig v1.
38.3|install twig/twig v1.38.4|install twig/twig v1.39.0|install twig/twig v1.39.1|install twig/twig v1.40.0|install twig/twig v
1.40.1|install twig/twig v1.41.0|install twig/twig v1.42.0|install twig/twig v1.42.1|install twig/twig v1.42.2|install twig/twig
v1.42.3|install twig/twig v1.42.4|install twig/twig v1.42.5|install twig/twig v2.0.0|install twig/twig v2.1.0|install twig/twig
v2.2.0|install twig/twig v2.3.0|install twig/twig v2.3.1|install twig/twig v2.3.2|install twig/twig v2.4.0|install twig/twig v2
.4.1|install twig/twig v2.4.2|install twig/twig v2.4.3|install twig/twig v2.4.4|install twig/twig v2.4.5|install twig/twig v2.4.
6|install twig/twig v2.4.7|install twig/twig v2.4.8|install twig/twig v2.5.0|install twig/twig v2.6.0|install twig/twig v2.6.1|i
nstall twig/twig v2.6.2|install twig/twig v2.7.0|install twig/twig v2.7.1|install twig/twig v2.7.2|install twig/twig v2.7.3|inst
all twig/twig v2.7.4|install twig/twig v2.8.0|install twig/twig v2.8.1|install twig/twig v2.9.0|install twig/extensions v1.0.0|i
nstall twig/extensions v1.0.1|install twig/extensions v1.1.0|install twig/extensions v1.2.0
I tried to override the template 'manager.html.twig' by creating a new template under 'templates/bundles/FileManagerBundle/manager.html.twig' but it doesn't work.
Did I do wrong? what is the best way to do this?
Button "Add files" does not work unter Firefox and Internet Explorer.
Symfony 3.4.14
artgris/FileManagerBundle 1.3.2
Firefox ESR 52.9.0 and Firefox Quantum 61.0.2 and also Internet Explorer 11.
Google Chrome ist working fine.
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
artgris_file_manager:
# web_dir: web
conf:
default:
dir: "img/uploads"
I use a symfony buil-in-server to test.
i use this bundle on a symfony 4 proyect and no have any problems.
Hello,
With last update, i have an error when i try to clear cache.
The message done is :
PHP Parse error: syntax error, unexpected '?' in /home/valkur/projects/ras.com/vendor/artgris/filemanager-bundle/Helpers/FileManager.php on line 265
09:58:18 CRITICAL [php] Fatal Parse Error: syntax error, unexpected '?' ["exception" => Symfony\Component\Debug\Exception\FatalErrorException { …}] []
I have fix this issue with these modifications :
private function mergeQueryAndConf($parameter, $default = null)
{
//return $this->getQueryParameter($parameter) ? $this->getConfigurationParameter($parameter) : $default;
return isset($this->getQueryParameter($parameter)) ? $this->getConfigurationParameter($parameter) : $default;
}
private function mergeConfAndQuery($parameter, $default = null)
{
//return $this->getConfigurationParameter($parameter) ? $this->getQueryParameter($parameter) : $default;
return isset($this->getConfigurationParameter($parameter)) ? $this->getQueryParameter($parameter) : $default;
}
When is search on google =) i have found its a new operator required by php7. My fix work with php5.6
It is possible to add some kind of image loading system, so that the loading of images is not slowed down, I just applied your bundle to my Uploads folder and to have many images has taken a long time to load.
Congratulations for your Bundle, great work.
Hi,
I can't upload pdf or docs even on your demo version is that normal ?
Good job for this bundle by the way !
Hello,
First, thanks for the work!
i found a "workaround" (frame) to embed the file manager into a twig template after a few try of overrides.
Do I missed something or there is a "simple" way to embed the file manager into a view ?
If not, could it be possible ? A reason to avoid it ?
Regards,
Hi. I'm trying to install a bundle, but in return I get an error:
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
Invalid key "router" found in arguments of method "__construct()" for servi
ce "file_type_service": only integer or $named arguments are allowed.
when executing the command:
./bin/console assets:install --symlink
I use Symphony 3.3.10 and PPP 7.0.15
Help please understand what the problem is.
Thanks
Hi,
i want to upload files using the bundle artgris/FileManagerBundle
and i want the uploaded files override the existing ones that have the same name.
Thank you for your help.
Hey!
First of all, thank you for such a great public project!
I want to integrate with Amazon S3, do you think it is possible to integrate with Flysystem or Gaufrette throw the service configuration that you provide? Or maybe fork this project.
Thanks!
It would be ideal to have the option that by clicking on the image you can in a modal window with the larger image.
I would like to use the names of the files (per row, listed as list) also as links. Using links (<a href= ...) around them, instead of always clicking on the download button. Also my Table rows are not clickable, using the custom configuration. Any ideas for me? Thank you
I was trying to symlink upload directory but FileManager does not allow it.
# \Artgris\Bundle\FileManagerBundle\Helpers\FileManager::checkSecurity
$currentPath = $this->getCurrentPath();
// check Path security
if (false === $currentPath || 0 !== mb_strpos($currentPath, $this->getBasePath())) {
throw new HttpException(Response::HTTP_UNAUTHORIZED, 'You are not allowed to access this folder.');
}
getCurrentPath resolves symlinks and yields outside configured directory. But I think this is unnecessary restriction.
Hello,
I don't understand because when I use "path('file_manager', { conf : 'composant' extra: {'id': id}})" the URL created is "...manager/?conf=composant&extra%5Bid%5D=60", buts with the "amp;" the URL is not working. Why Symfony add "amp;" to my URL ?
Thanks.
Hi want to upload all files to other server . How can i perform cross domain file manager functionality.
Hello, i use fileManagerBundle 1.4 with TinyMCE v5. When I insert an image, the modal opens and when I select the image I want, nothing happens and I get the error
manager.js:164 Uncaught TypeError: top.tinymce.activeEditor.windowManager.getParams is not a function at HTMLTableCellElement.<anonymous> (manager.js:164) at HTMLFormElement.dispatch (jquery.min.js:3) at HTMLFormElement.q.handle (jquery.min.js:3)
Sorry for my English, Thanks
php - 7.4.14
composer - 2.0.2
Symfony - 5.1.11
I installed this bundle via composer as per the README.
Registered all configuration files
As a result, when I try to go to the page /manager/?conf=default - css and js are not loaded, they are loaded as a simple page, and not as files.
Hi,
Nice work !
I found an issue while testing your bundle. When you configure "upload > image_versions", renaming action will only rename the original.
Edit : in order to remove deprecation warning, you have to update the route annotation to :
use Symfony\Component\Routing\Annotation\Route
Hello,
First of all congratulations for your work.
I would like to know how to return multiple directories from a service.
Indeed, following your documentation I managed to create a service that returns an array with the target directory (like this):
return [ 'dir' => '../web/uploads/super_admin' ];
But, in my case, i would like to return multiple directories (like this):
return [ 'dir' => ['../web/uploads/super_admin', '../web/uploads/admin'] ];
Like this, the user can access multiple folders at the same time.
Because some directories are not nested with each other!
Could you give me an answer?
We wanted to integrate this in an existing project that uses Foundation as css framework. It should be nice to be able to choose an unstyled version. So we can do the styling ourselves while the functionality stays. Because when we throw out some bootstrap stuff in the twig file, things get broken.
I am trying to create a custom config in Symfony 4 and got an error: "The "file_manager_configuration" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.".
I made a little research and found this line in your code:
$conf = $this->get($managerConf[$conf]['service'])->getConf($extra);
How I understood we are not allowed to get services right from container and must use dependency injection in Symfony 4.
Here is the same issue in another bundle with solution example: liip/LiipImagineBundle#1033
Hi,
i use your bundle on project with ckeditor module but it seems to be not compatible with Internet Explorer.
In manager.js file, the line below doesn't work :
var url = new URL(window.location.href);
IE does not support URL
templates/bundles/ArtgrisFileManagerBundle/manager.html.twig
manager.html.twig ->
{% extends "@ArtgrisFileManager/manager.html.twig" %}
error:
Maximum function nesting level of '256' reached, aborting!
Hi i am trying to use your file manager with symfony 4 but i can’t find the files that you specified in the documentation obviously because the structure changed even though i tried to set the equivalent by adding the next block of code into services.yml
Artgris\Bundle\FileManagerBundle\Helpers\FileManager:
arguments:
$webDir: '%upload_directory%'
and this one on routes.yml
artgris_bundle_file_manager:
path: /manager
controller: Artgris\Bundle\FileManagerBundle\Controller\ManagerController::indexAction
but it throws and error: Please define a conf parameter in your route, can you give me a little support on this please?
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:
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.
It would be nice to have a file versioning system so that you can for ex. upload a file called test.pdf multiple times and see a file history of all versions of a file.
Here's my conf:
artgris_file_manager:
web_dir: public
conf:
default:
dir: "../public/uploads/"
type: image
If I upload an image there, and rename it without manually respecifying its extension:
it will disappear from the list because it's filtered out, since the list only accepts images.
the file will still be there and renamed properly however, just without any extension
Is there any way to improve this ?
Thanks
Hi,
I'm just trying to install the bundle, and after following the installation steps, I get this error :
Please define a "dir" or a "service" parameter in your config.yml.
I've checked and re-checked every yml
file, tried to add an other conf, a service, but I don't get it. I must have missed something somewhere. My files are a little bit different though, as routing.yml
in the readme is routes.yml
for me, maybe it could come from there.
Below my different versions :
$ php -v
PHP 7.4.3 (cli) (built: Oct 6 2020 15:47:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
$ composer -V
Composer version 2.0.9
$ symfony -V
Symfony CLI version v4.23.2 (2021-03-02T17:16:03+0000 - stable)
I've found this issue artgris/MediaBundle#51 which seems similar, but since it's not the same bundle, files are different, and I don't know how to get the "Debug" line.
If you need any more info, let me know and I'll upload it.
Thanks for your help!
Hello, on the readme in the feature i see "File Upload widget used : blueimp/jQuery-File-Upload" with "Client-side image resizing/crop" but when i edit a file to the filemanager i dont have this interface
https://blueimp.github.io/jQuery-File-Upload/ . Is it possible to have it ?
Hi there,
Iam using Symfony 4.2 and just installed the file manager. There was a problem in the ManagerController, so i got the error
Notice: Undefined property: stdClass::$url
I took a look on it.
ManagerController:277
$file->url = $this->generateUrl('file_manager_file', array_merge($fileManager->getQueryParameters(), ['fileName' => $file->url]));
After dumping $file, i changed it to $file->name and it works.
Is there any reason for using "url" or did I found a bug?
Kind regards
Kai
Hi
This is my code for show url in input typr on button click
$(document).ready(function(){
$('#myframe').on('load', function () {
$(this).contents().on('click','.select',function () {
var path = $(this).attr('data-path')
$('#path').val(path);
$('#image').attr('src', path)
$('#myModal').modal('hide')
});
});
});
But unable to set selected image url in input type.
Also
$(this).contents().on('click','.select',function ()//
in this line of code unable to find .select class in modal view.
Hi, my config is:
conf:
public:
dir: "../public/uploads"
tree: true
upload:
image_versions: {'': {crop: true, max_width: 10, max_height: 10}}
And on lists i my images are in orginal file. Maybe need to update a .twig file _list.html.twig do display image version/variation.
Tnx
Hello,
I'm trying to use your bundle on my Symfony3.4 project and, after configuration, it says
Invalid service "file_type_service": method "Artgris\Bundle\FileManagerBundle\Service\FileTypeService::__construct(
)" has no argument type-hinted as "router". Check your service definition.
What am I doing wrong?
Thank you in advance.
I can't make work tree=false configuration.
I first confirgure it in .yaml file and don't work and now I make it using service and it also doesn't work...
In YAML:
artgris_file_manager:
web_dir: public # set your public Directory (not required, default value: web)
conf:
default:
dir: "../public/uploads"
tree: false
When I make it in service in the service return:
return ['dir' => $folder, 'tree' => False];
Hello,
I've installed and configured the bundle, but got an error when I want to upload a file, the file is well uploaded but i got an error like this
Service "translator" not found: even though it exists in the app's container, the container inside "Artgris\Bundle\FileManagerBundle\Controller\ManagerController" is a smaller service locator that only knows about the "doctrine", "form.factory", "http_kernel", "parameter_bag", "request_stack", "router", "security.authorization_checker", "security.csrf.token_manager", "security.token_storage", "serializer", "session" and "twig" services. Try using dependency injection instead.
All the bundle is well translated in French in my case but when the upload failed it's written in English File Upload Failed
Thank in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.