mercredi 19 juillet 2017

MethodNotAllowedHttpException multiple file upload with dropzone

When I try to upload more than 4 files with dropzone, I always throw this error:

MethodNotAllowedHttpException in RouteCollection.php line 218:

this is mi php code:

 $route = storage_path('App/images/');

    foreach ($request->file as $img){
        $img = Image::make($img);
        $img->save($route.$img->filename.'.jpg');
    }
return response()->json('ok');

dropzone code:

Dropzone.autoDiscover = false;
        $("#images").dropzone({
            autoProcessQueue: false,
            uploadMultiple: true,
            parallelUploads: 100,
            maxFiles: 100,
            paramName: "file",
            maxFilesize: 9999999,
            acceptedFiles: '.jpg,.jpeg,.png,.bmp',
            url:'',  
            init: function() {
                var myDropzone = this;

                document.querySelector("#submit").addEventListener("click", function(e) {
                    e.preventDefault();
                    e.stopPropagation();
                    myDropzone.processQueue();
                    console.log(1);
                });
                this.on("sending", function (file, xhr, formdata) {
                    formdata.append("_token", '');
                    var dataform =  $('#NewActivityForm').serialize();
                    formdata.append('dataForm', dataform);
                })
            }});

Why does this error come out?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2uIxpXT
via IFTTT

Aucun commentaire:

Enregistrer un commentaire