Elfinderd: php file manager connector.php - php

I am trying to add http://elfinder.org which is the most professional php file manager on the web, i have uploaded the file in a subfolder http://example.com/admin but the connector does not work
$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => '../files/', // path to files (REQUIRED)
'URL' => dirname($_SERVER['PHP_SELF']) . '/../files/', // URL to files (REQUIRED)
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
)
)
);
in my web-host panel this is the address to my account
/dns/in/olympe/moderactif
but I really can't set the correct paths
Can you help me?

Related

Open FTP files in elFinder without giving details

I am using elFinder for manage my FTP files. But I want to open FTP files and folders without giving FTP details. I keep elFinder files on same FTP. Is it possible?
In connector.php:
$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver' => 'FTP',
'path' => 'here i give path of folder',
'accessControl' => 'access' ,
'tmpPath' => '../files/ftp',// disable and hide dot starting files (OPTIONAL)
'defaults' => array('read' => true, 'write' => true),
'disabled' => array('rename', 'rm' , 'copy' ,'cut','paste')
)
)
);
but when I used this. I get this error:
Invalid backend configuration. Readable volumes not available.
I found the solution for this.To open files we dont need to use ftp option in driver just use localfilesystem and give path of files according to server.
$opts = array(
// 'debug' => true,
' roots' => array(
array(
'driver' => 'localFileSystem',
'path' => 'path of the folder that you want to browse',
'accessControl' => 'access' ,
'defaults' => array('read' => true, 'write' => true),
'disabled' => array('rename', 'rm' , 'copy' ,'cut','paste')
)
)
);

Mapping a drive in elfinder inside files folder

Here I am mapping D drive in elfinder
I am not able to open files.
Here's my code.
$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => 'D:/pdf/', // path to files (REQUIRED)
'URL' => 'D:/pdf/', // URL to files (REQUIRED)
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
)
)
);
Normally browser will open only url not path. We have to convert path into url.
If you want to map a drive (D drive) create a virtual directory in XAMMP.
Add below code in httpd-vhosts.conf
<VirtualHost *:80>
<Directory "D:/pdf">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
Require all granted
</Directory>
ServerAdmin anbu#local.dev
DocumentRoot "D:/pdf"
ServerName local.dev
</VirtualHost>
Now restart your server.
modify url in blow code
$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => 'D:/pdf/', // path to files (REQUIRED)
'URL' => 'http://local.dev', // URL to files (REQUIRED)
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
)
)
);
hope it will work :)
Your URL is incorrect. Please see the example in the documentation:
$opts = array(
'locale' => '',
'roots' => array(
array(
'driver' => 'LocalFileSystem',
'path' => '/path/to/files/',
'URL' => 'http://localhost/to/files/'
)
)
);

Adding a variable into a path inside an array

Is it possible to add a variable into the line in bold?
$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
**'path' => '/csgo', // path to files (REQUIRED)**
'URL' => dirname($_SERVER['PHP_SELF']) . '/../files/', // URL to files (REQUIRED)
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
)
)
);
changing it to this did not help
'path' => ".$folder./csgo", // path to files (REQUIRED)
thank you
It should be:
'path' => "$folder/csgo"
A slightly better way:
'path' => "{$folder}/csgo"
This clearly shows the separation of the variable from the string

Not able to restrict other files from uploading in ElFinder

I am using this configuration for my Elfinder to use with CKEditor.
$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => '../../uploads/', // path to files (REQUIRED)
'URL' => dirname($_SERVER['PHP_SELF']) . '/../../uploads/', // URL to files (REQUIRED)
'accessControl' => 'access' , // disable and hide dot starting files (OPTIONAL)
'uploadAllow' => array('image/jpg', 'image/png'),
'alias' => 'Home',
'mimeDetect' => 'internal',
'imgLib' => 'gd',
),
),
);
However, I am able to upload all the files even PHP files!! I only want images to be uploaded. I am not able to restrict the uploading. Where am I going wrong?
Add:
'uploadOrder'=> array( 'allow', 'deny' )
Without this the default policy is allow if none of them matches.
According to:
https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options#wiki-uploadOrder

ElFinder + Hide Directory

I am currently using ElFinder 2.0 .
I want to hide some directory inside the main directory.
How can i do that?
I tried in connector.php file
but not succeeded.
This is my code
$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => '/home/workioscProject/public_html/codensa/catalogo', // path to files (REQUIRED)
'URL' => 'http://76.76.163.155/workioscProject/codensa/catalogo/', // URL to files (REQUIRED)
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
),
),
'attributes' => array(
array(// hide anything else
'pattern' => '!^/exportForms!',
'hidden' => true
)
)
);
// run elFinder
$connector = new elFinderConnector(new elFinder($opts));
$connector->run();
What i do?
Thanks in advance.
$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => '/home/workioscProject/public_html/codensa/catalogo', // path to files (REQUIRED)
'URL' => 'http://76.76.163.155/workioscProject/codensa/catalogo/', // URL to files (REQUIRED)
'accessControl' => 'access' , // disable and hide dot starting files (OPTIONAL)
'attributes' => array(
array(// hide anything else
'pattern' => '!^/exportForms!',
'hidden' => true
)
)
),
)
);

Categories