3

i'm trying to configure elfinder plugin in order to allow uploading PDF files, but am not able.

Error: this kind of files are not allowed.

My codes:

$opts = array(
    'roots' => array(
            array(
                'driver' => 'LocalFileSystem',           // driver for accessing file system (REQUIRED)
                'path' => '../files/' . $id . '/',                 // path to files (REQUIRED)
                'URL' => dirname($_SERVER['PHP_SELF']) . '/files/' . $id . '/', // URL to files (REQUIRED)
                'uploadDeny' => array('all'),                // All Mimetypes not allowed to upload
                'uploadAllow' => array('image', 'text/plain', 'application/pdf'),// Mimetype `image` and `text/plain` allowed to upload
                'uploadOrder' => array('deny', 'allow'),      // allowed Mimetype `image` and `text/plain` only
                'accessControl' => 'access',                     // disable and hide dot starting files (OPTIONAL)
                'uploadMaxSize' => '10M'    
        )
    )
);

Thanks for your help.

Souheil Diab
  • 41
  • 1
  • 3

1 Answers1

-1

merge this array into your config uploadAllow.

array('application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream')

this's mime base on Codeigniter mimes