E
E
Eugene2016-06-05 19:00:28
JavaScript
Eugene, 2016-06-05 19:00:28

For some reason I can't upload files when customData is specified?

Tell me who can come across. When initializing the plugin itself, I specify an addition to the path in customData in order to limit the user's work only in his directory.

var elf = $('#elfinder').elfinder({
                lang: 'ru',
                resizable: false,
                useBrowserHistory: false,
                url : '/js/plugins/elFinder/php/connector.php',
                customData : {folderId : '2016'},
                onlyMimes: ["image"]
            }).elfinder('instance');


In the connector itself, I add the resulting variable to the path:
....
'roots' => array(
    array(
      'driver'        => 'LocalFileSystem', 
      'path'     => '/mypatch/'.$_GET['folderId'],
      'URL'      =>  '../mypatch/'.$_GET['folderId'],
      'uploadDeny'    => array('all'), 
      'uploadAllow'   => array('image', 'text/plain'),
      'uploadOrder'   => array('deny', 'allow'),
      'accessControl' => 'access' 
    )
  )
...


When passing a parameter via "customData" and UPLOAD files, they are still loaded into the default directory: "/mypatch/".
If you hardcode the path "/mypatch/2016" in the connector, then everything is fine. And from script parameter does not give.
Although the connector receives data, because when the plugin is initialized, it restricts it to this directory, and the problem is with the loading.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question