danielruuth-vue-file-upload

3.0.2 • Public • Published

vue-file-upload

File upload component

  • drag and drop / file chooser
  • multiple upload (except for IE9)
  • add more files during upload
  • overall progress bar
  • no dependency

Original fileuploader by Frank Freiburger, modified for Laravel by Daniel Ruuth

Browser support

Same browser support as Vue.js 2

Example

<template>
  <div>
    <upload url='/upload'></upload>
  </div>
</template>

Install

npm install --save danielruuth-vue-file-upload

API

Properties

:url string

Target url for the uploaded files (post multipart/form-data).

:multiple boolean, default: false

Allow multiple files to be uploaded simultaneously.

:image boolean, default: false

Indicate that you wish to upload images.

:capture boolean, default: false

Indicates that the capture of media directly from the device's environment using a media capture mechanism is preferred. See capture attribute

:accept function(filename) returns boolean

Called before a file is about to be uploaded. Return false to reject the upload, otherwise return true.

filename: The filename (without path) of the file.

By default any file is accepted.

:done function(status, responseText, feedback)

Called when a file or a set of files has been uploaded.

status: HTTP status of the upload or undefined if no status is available (IE9).
responseText: reponse of the server.
feedback: function you can call to give a positive or negative (true/false) UI feedback about the upload.

By default, if the property is not defined, a positive feedback is send for HTTP status 2xx and 3xx

:data string

Extra data sent with files (name=data).

Credits

Readme

Keywords

Package Sidebar

Install

npm i danielruuth-vue-file-upload

Weekly Downloads

2

Version

3.0.2

License

MIT

Unpacked Size

13.7 kB

Total Files

5

Last publish

Collaborators

  • danielruuth