mardi 27 octobre 2015

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data Error On laravel 5

I am using bootstrap file-input plugin to upload images.

Here is js Code:

     var product_id = $('input#product_id').val();

     $("input.ups").fileinput({
         uploadUrl: "/imalatci/products/uploadimages",
         allowedFileExtensions: ["jpeg","jpg", "png", "gif"],
         maxImageWidth: 500,
         maxImageHeight: 400,
         maxFileCount: 5,
         resizeImage: true,
         language:"tr",
         uploadExtraData: function() {
             return {
                 product_id: product_id
             };
         }
     }).on('filepreupload', function() {
         $('#kv-success-box').html('');
     }).on('fileuploaded', function(event, data) {
         $('#kv-success-box').append(data.response.link);
         $('#kv-success-modal').modal('show');
     });

When I try to upload a image on Laravel 5 , I am getting this error:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data.

And Here is My JSON Values:

Array
(
    [file_id] => 0
    [product_id] => 8
    [images] => Array
        (
            [0] => Symfony\Component\HttpFoundation\File\UploadedFile Object
                (
                    [test:Symfony\Component\HttpFoundation\File\UploadedFile:private] => 
                    [originalName:Symfony\Component\HttpFoundation\File\UploadedFile:private] => Screenshot from 2015-10-19 150133.png
                    [mimeType:Symfony\Component\HttpFoundation\File\UploadedFile:private] => image/png
                    [size:Symfony\Component\HttpFoundation\File\UploadedFile:private] => 19066
                    [error:Symfony\Component\HttpFoundation\File\UploadedFile:private] => 0
                    [pathName:SplFileInfo:private] => /tmp/phpnbNIJk
                    [fileName:SplFileInfo:private] => phpnbNIJk
                )
        )
)

How Can I Solve This?



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

Aucun commentaire:

Enregistrer un commentaire