I have set up elfinder and elrte according to the docs but for some reason elfinder is not showing any of the files I have in the folder when I open it up via the elrte interface. It is also not passing the image into elrte. It is however uploading images to the folder, I just can't see this being done.
Has anyone else had this problem?
Here is the code from my page:
<!-- ELRTE Editor Files -->
<link rel="stylesheet" href="elr/css/smoothness/jquery-ui-1.8.13.custom.css" type="text/css" media="screen" charset="utf-8">
<link rel="stylesheet" href="elr/css/elrte.min.css" type="text/css" media="screen" charset="utf-8">
<script src="elr/js/jquery-1.6.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="elr/js/jquery-ui-1.8.13.custom.min.js" type="text/javascript" charset="utf-8"></script>
<script src="elr/js/elrte.min.js" type="text/javascript" charset="utf-8"></script>
<script src="elr/js/i18n/elrte.en.js" type="text/javascript" charset="utf-8"></script>
<!-- END ELRTE Files -->
<!-- ELFINDER Files -->
<link rel="stylesheet" type="text/css" media="screen" href="elrfinder/css/elfinder.min.css">
<script type="text/javascript" src="elrfinder/js/elfinder.min.js"></script>
<!-- Mac OS X Finder style for jQuery UI smoothness theme (OPTIONAL) -->
<!--<link rel="stylesheet" type="text/css" media="screen" href="css/theme.css">-->
<script type="text/javascript" charset="utf-8">
$().ready(function() {
$('.textareaWidth').elrte({
lang: 'en', // elRTE language (OPTIONAL)
fmOpen : function(callback) {
$('<div/>').dialogelfinder({
url : 'http://stamfordfish-and-game.com/elrfinder/php/connector.php', // connector URL (REQUIRED)
lang: 'en', // elFinder language (OPTIONAL)
commandsOptions: {
getfile: {
oncomplete: 'destroy' // destroy elFinder after file selection
}
},
getFileCallback: function(file) { callback(file.url); }
});
}
});
});
</script>
<!-- END ELFINDER FILES -->
And here is the code from my connector:
<?php
error_reporting(0); // Set E_ALL for debuging
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderConnector.class.php';
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinder.class.php';
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeDriver.class.php';
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeLocalFileSystem.class.php';
// Required for MySQL storage connector
// include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeMySQL.class.php';
// Required for FTP connector support
// include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeFTP.class.php';
/**
* Simple function to demonstrate how to control file access using "accessControl" callback.
* This method will disable accessing files/folders starting from '.' (dot)
*
* @param string $attr attribute name (read|write|locked|hidden)
* @param string $path file path relative to volume root directory started with directory separator
* @return bool|null
**/
function access($attr, $path, $data, $volume) {
return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot)
? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true
: null; // else elFinder decide it itself
}
$opts = array(
//'debug' => true,
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => 'C:\Inetpub\wwwroot\stamfordfish-and-game.com\website\elrfinder\files\\', // path to files (REQUIRED)
'URL' => 'C:\Inetpub\wwwroot\stamfordfish-and-game.com\website\elrfinder\files\\', // URL to files (REQUIRED)
//'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
)
)
);
// run elFinder
$connector = new elFinderConnector(new elFinder($opts));
$connector->run();
I have the same problem. When looking in the response elFinder get, I can see that it gets all the files in the folder, it will just not render out any layout for them..
Figured it out.. path and URL must be without ending slash...
Figured it out.. path and URL must be without ending slash...
You save me the day <3 genius!
Most helpful comment
Figured it out.. path and URL must be without ending slash...