barryvdh / laravel-elfinder

elFinder bundle for Laravel
739 stars 171 forks source link

filebrowserUploadUrl misssing #94

Open mspiderv opened 9 years ago

mspiderv commented 9 years ago

filebrowserBrowseUrl: '/elfinder/ckeditor' but filebrowserUploadUrl: '????'

macdabby commented 8 years ago

I'm trying to work this out myself.

filebrowserUploadUrl = /elfinder/connector.php?cmd=upload

The problem is that the elFinder lib looks for cmd in the $_POST variable. So you need to add this to your connector.php file:

if (!empty($_POST) && empty($_POST['cmd']) && !empty($_GET['cmd'])) {
    $_POST['cmd'] = $_GET['cmd'];
}

But then the $_FILES variable doesn't match up. Also you have to somehow get a hash of the directory that has to be passed in the $_POST variable.

I think it would be much more practical to write a custom upload script for CKEditor that handles uploads, since there are no options for directory, etc. Like this: http://ckeditor.com/comment/135074#comment-135074