barryvdh / laravel-elfinder

elFinder bundle for Laravel
745 stars 171 forks source link

Elfinder file upload throwing MethodNotAllowedHttpException in RouteCollection.php line 207 #101

Open careyestes opened 9 years ago

careyestes commented 9 years ago

First, can I use elfinder for file uploads? The doc mentions it for the browser, but doesn't talk about the file upload option.

If I cannot, then that explains the issue. But as a followup, what is commonly used to manage file uploads? Just a home grown solution?

If I can use Elfinder as a file upload solution, can anyone explain the exception thrown?

FerchoCarcho commented 9 years ago

@barryvdh Help us making a route for achieveing the controller, in :

$().ready(function() {
            var funcNum = getUrlParam('CKEditorFuncNum');

            var elf = $('#elfinder').elfinder({
                // set your elFinder options here
                <?php if($locale){ ?>
                    lang: '<?= $locale ?>', // locale
                <?php } ?>
                customData: { 
                    _token: '<?= csrf_token() ?>'
                },
                url: '<?= route("elfinder.connector") ?>',  // connector URL
                getFileCallback : function(file) {
                    window.opener.CKEDITOR.tools.callFunction(funcNum, file.url);
                    window.close();
                }
            }).elfinder('instance');
        });

there is

url: '<?= route("elfinder.connector") ?>', 

where we should specify the route to land for posting the image right? can you show some configurations to do that please? how can I acces that elfinder.connector properties to set my route? I think we need apart from that more variables to be set for the image to upload, please shed some light. so the 502 error can reach it destiny route...