Skip to content

WeS3Dropzone ​

A highly interactive and flexible component for uploading files to S3. It supports drag & drop, previews, validations, and fully customizable interactions.

Examples ​

Basic Usage ​

By default, the component allows uploading one file of any type

vue
<we-s-3-dropzone />

Multiple ​

If true enable possibility to add more than 1 file

vue
<we-s-3-dropzone multiple />

Accepted Files ​

List of accepted files

vue
<we-s-3-dropzone accepted-files=".csv,.xls,.xlsx'" />

Max files ​

Max files possible to upload

vue
<we-s-3-dropzone :max-files="5" />

Hide remove all ​

Hide remove files button

vue
<we-s-3-dropzone hide-remove-all />

Existing attachments ​

Binding through which separate management of existing attachments is achieved

vue
<we-s-3-dropzone
  v-model="model"
  v-model:existing-attachments="existingAttachments"
/>

Events ​

Possible events that can be handled by the component

vue
  <we-s3-dropzone
    @progressing="handleProgressing"
    @reset="onReset"
  />

Features ​

  • Drag & drop support with visual feedback
  • File validation (extensions, duplicates, max count)
  • Custom file type icons and colors with image preview dialog
  • Automatic S3 upload integration
  • Duplicate prevention
  • Emits progressing and reset events

Props ​

PropTypeDefaultDescription
titleStringnullAllows you to change the default title of the component: "Select or drag the file to upload"
multipleBooleanfalseAllows multiple file uploads
acceptedFilesStringnullAccepted file extensions, comma-separated
maxFilesNumber/StringnullMaximum number of files allowed
hideRemoveAllBooleanfalseHides the "Remove files" button
signedUrlStringnullIf provided, the signed URL will be requested from this endpoint instead of the default: "storage/signed_url"

v-model Bindings ​

The component provides several v-model bindings for controlling its state:

BindingTypeDescription
v-model:existing-attachmentsArrayList of existing documents, loaded without uploading on S3

Events ​

EventPayloadDescription
update:modelValueArray<File>Emitted whenever the list of uploaded files changes
progressingBooleanIndicates if all files have finished uploading
resetanyEmitted when the component is cleared

Exposed Methods ​

MethodDescription
getFiles()Returns an array of uploaded file data
clearFile()Clears all uploaded files

File Object Structure ​

Each uploaded file contains:

js
{
  name: String,
  size: Number,
  type: String,
  s3: {
    uuid: String,
    key: String,
    url: String,
  }
}