rowanwins / vue-dropzone

A Vue.js component for Dropzone.js - a drag’n’drop file uploads utility with image previews
https://rowanwins.github.io/vue-dropzone/docs/dist
MIT License
2.02k stars 1.4k forks source link

maxFilesize does not seem to work #628

Open santos2408 opened 1 year ago

santos2408 commented 1 year ago

Hello everyone, I need help with the component. I'm trying to limit the allowed image size for upload. I have already tried adding the "maxFilesize" property in the "options" section, and I have also tried directly adding the "max-file-size" property to the component, but nothing is working.

Regardless of the option I choose, the component always prevents adding images larger than 2MB.

component:

<dropzone 
        id="myVueDropzone" 
    ref="myVueDropzone" 
    :url="upload" 
    v-on:vdropzone-success="showSuccess"
    :max-number-of-files="maxFiles"
    :use-custom-dropzone-options="true"
    :dropzone-options="dropzoneOptions"
    :max-file-size="2">
    <input type="hidden" name="_token" v-model="token">
</dropzone>

options:

dropzoneOptions: {
    language: {
        dictDefaultMessage: '<div class="dz-icon icon-wrap icon-circle icon-wrap-md"><i class="fa fa-cloud-upload fa-3x"> 
                </i></div><div><p class="dz-text">Arraste as imagens aqui</p><p class="text-muted">ou click para selecionar 
                manualmente</p></div>',
        dictFileTooBig:'Arquivo muito grande. Maximo permitido: 2Mb'
    }
}

Does anyone know how to solve this?

DJKStyles commented 1 year ago

💋seid dabei

danielverissimo commented 1 year ago

@santos2408 the correct param name is maxFileSizeInMB.