Skip to content
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

[VD:abstract] problem of detect MIME-Type as 'unknown' with the zero size file #2352

Closed
haooodev opened this issue Jan 9, 2018 · 1 comment
Assignees
Labels

Comments

@haooodev
Copy link

haooodev commented Jan 9, 2018

Hey guys, i recently install elFinder with the original php connector and configure it as the wiki saying.
When i visit the root path, it seems work, and get the following page and http response .

screenshot_2018-01-09_17-38-57
screenshot_2018-01-09_17-52-37

But i cant edit the txt file, i.e. a.yml.
Following is my configuration and file permission.

$opts = array(
        // 'debug' => true,
        'roots' => array(
                // Items volume
                array(
                        'driver'        => 'LocalFileSystem',           // driver for accessing file system (REQUIRED)
                        //'path'          => '../files/',                 // path to files (REQUIRED)
                        'path'          => '/etc/ansible/roles',                 // path to files (REQUIRED)
                        //'URL'           => dirname($_SERVER['PHP_SELF']) . '/../files/', // URL to files (REQUIRED)
                        'URL'           => '/etc/ansible/roles' . '/../files/', // URL to files (REQUIRED)
                        'trashHash'     => 't1_Lw',                     // elFinder's hash of trash folder
                        'winHashFix'    => DIRECTORY_SEPARATOR !== '/', // to make hash same to Linux one on windows too
                        //'uploadDeny'    => array('all'),                // All Mimetypes not allowed to upload
                        'uploadDeny'    => array(),                // All Mimetypes not allowed to upload
                        //'uploadAllow'   => array('image', 'text/plain'),// Mimetype `image` and `text/plain` allowed to upload
                        'uploadAllow'   => array('all'),         // Mimetype `image` and `text/plain` allowed to upload
                        // 'uploadOrder'   => array('deny', 'allow'),      // allowed Mimetype `image` and `text/plain` only
                        'uploadOrder'   => array('allow', 'deny'),      // allowed Mimetype `image` and `text/plain` only
                         'accessControl' => 'access',                     // disable and hide dot starting files (OPTIONAL)
                        'attributes'    => array(
                               array(
                                     'pattern' => '.yml',
                                     'read' => true,
                                     'write' => true,
                                     'locked' => true,
                               )
                        )
                ),
// Trash volume
                array(
                        'id'            => '1',
                        'driver'        => 'Trash',
                        'path'          => '../files/.trash/',
                        'tmbURL'        => dirname($_SERVER['PHP_SELF']) . '/../files/.trash/.tmb/',
                        'winHashFix'    => DIRECTORY_SEPARATOR !== '/', // to make hash same to Linux one on windows too
                        'uploadDeny'    => array('all'),                // Recomend the same settings as the original volume that uses the trash
                        'uploadAllow'   => array('image', 'text/plain'),// Same as above
                        'uploadOrder'   => array('deny', 'allow'),      // Same as above
                        'accessControl' => 'access',                    // Same as above
                )
        )
);

ls -l /etc/ansible/roles/a.yml
-rw-r--r-- 1 root root 0 Jan 8 02:35 /etc/ansible/roles/a.yml

@nao-pon nao-pon self-assigned this Jan 10, 2018
@nao-pon nao-pon changed the title How to make elfinder actually work [VD:abstract] problem of detect MIME-Type as 'unknown' with the zero size file Jan 10, 2018
@nao-pon
Copy link
Member

nao-pon commented Jan 10, 2018

@haozhaodev The elFinder php connector sets the MIME type to "unknown" if the MIME type of the extension is unknown and the file size is zero. This is a problem when creating a text file so I will fix this.

Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants