jeudi 29 août 2019

Vue dropzone thumbnail is not showing after upload

I am making a system with laravel and vuejs . I am using vue dropzone for image upload process . the problem is my files are uploading on the server but i can not preview the thumbnail on my client side . I searched multiple times but didn't find any solution .

I have used basic demo from vue2-dropzone . But there i saw thumbnails are generating without any external function . i tried @vdropzone-complete="afterComplete" event and i could see the thumbnail details on the console afterComplete(file) { console.log(file); },

<vue-dropzone                                      
         ref="myVueDropzone"
         id="dropzone"
         @vdropzone-complete="afterComplete"
        :options="dropzoneOptions">
</vue-dropzone>
````````````````Here is my vue dropzone code
dropzoneOptions: {
                    url: '/api/photos/upload',
                    acceptedFiles: '.jpg,.jpeg,.png,.gif',
                    maxFiles: 6,
                    maxFilesize: 100,
                    addRemoveLinks: true,
                }
`````````````````Here is my laravel code for file upload
$objFile =    $request->file('file');
        $image =  time().$objFile->getClientOriginalName();
        @mkdir('image');
        $destinationPath = 'image';
        $objFile->move($destinationPath,$image);

Files are uploading on the server but i can not see them . Also is there any way to get the response from the server from vue upload so i can get the uploaded file names



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire