All Projects → updivision → vue2-multi-uploader

updivision / vue2-multi-uploader

Licence: MIT license
Drag and drop multiple file uploader with Vue.js v2 and Axios

Programming Languages

Vue
7211 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to vue2-multi-uploader

google-photos-upload
Upload a local image directory into an Album in Google Photos (works on mac/pc/linux). Coded in C# .NET Core 3.0
Stars: ✭ 26 (-43.48%)
Mutual labels:  upload-pictures, upload-images
uploadcare-rails
Rails wrapper for Uploadcare
Stars: ✭ 48 (+4.35%)
Mutual labels:  upload-pictures, upload-images
AndroidFlask
Image Upload from Android to Python-Based Flask Server
Stars: ✭ 45 (-2.17%)
Mutual labels:  upload-pictures, upload-images
TimeTableManager
Simple react application to create a TimeTable based only on your choice of subjects.
Stars: ✭ 30 (-34.78%)
Mutual labels:  axios
Stime
基于Vue-cli3(Vue+Vue-router)构建的单页单栏Typecho主题,全站Ajax+类Pjax(Vue-router)无刷新,自适应适配移动设备
Stars: ✭ 29 (-36.96%)
Mutual labels:  axios
github-admin
vue和element-ui搭建一個後台管理系統,使用github提供的api搞事情。輸入您的github賬號名自動幫你生成基本的github信息哦😯
Stars: ✭ 15 (-67.39%)
Mutual labels:  axios
vue-methods-promise
Let Vue methods support return Promise
Stars: ✭ 35 (-23.91%)
Mutual labels:  axios
square-mock
A simple mock-up of the Square Dashboard UI Kit using React, Redux, Webpack, Babel, and Firebase.
Stars: ✭ 21 (-54.35%)
Mutual labels:  axios
there-are-lots-of-people-in-Baiyun-airport
挑战杯 - 广州白云机场人流量时空分布预测系统 - 前端
Stars: ✭ 14 (-69.57%)
Mutual labels:  axios
api
Simple data loading for React
Stars: ✭ 35 (-23.91%)
Mutual labels:  axios
Vue2.0-music
vue2.0全家桶撸的在线音乐播放器1.0
Stars: ✭ 35 (-23.91%)
Mutual labels:  axios
vue-template
🎉 一个集成了 webpack + vue-loader + vuex + axios 的自定义 vue-cli 模板,其中包含 webpack 热更新,linting,测试以及 css 处理器等内容
Stars: ✭ 25 (-45.65%)
Mutual labels:  axios
ImagerJs
A JavaScript library for uploading images using drag & drop. Crop, rotate, resize, or shrink your image before uploading.
Stars: ✭ 101 (+119.57%)
Mutual labels:  upload-images
element-ui-demo
A element-ui admin base on vue2
Stars: ✭ 18 (-60.87%)
Mutual labels:  axios
cra-template-react-template
🤘 My bootstrap template to use in react
Stars: ✭ 15 (-67.39%)
Mutual labels:  axios
vite-vue3-starter
⭐ A Vite 2.x + Vue 3.x + TypeScript template starter
Stars: ✭ 384 (+734.78%)
Mutual labels:  axios
react-tools-for-better-angular-apps
Use React ecosystem for unified and top notch DX for angular developement
Stars: ✭ 30 (-34.78%)
Mutual labels:  axios
axios-elementui-
用axios和elementui做的一个增删改查的小例子
Stars: ✭ 22 (-52.17%)
Mutual labels:  axios
vue-element-admin
Vuejs实例-Vuejs2.0全家桶结合ELementUI制作后台管理系统http://www.cnblogs.com/weiqinl/p/6873761.html
Stars: ✭ 97 (+110.87%)
Mutual labels:  axios
noteworx-react-mongodb
A basic note application that uses React frontend to capture and manage notes, an api written in ExpressJS, and mongodb to store notes
Stars: ✭ 70 (+52.17%)
Mutual labels:  axios

vue2-multi-uploader

A drag and drop multiple file uploader component that uses Vue.js v2 and Axios. Uploader shows file names, sizes and total size of files added. It also allows setting a minimum required number of files to upload.

Demo

See live demo here.

Latest

PostData and other changes contributed by SergioReis97 via PR. Thanks! Message props contributed by Mushood via PR. Thank you!

Optional maxItems prop added to allow setting a maximum number of files allowed per upload.
Default maxItems is set to 30.

Optional method prop allows PUT method to be used. Default method remains POST, if you want to use PUT just add method="put" to your template.

Optional postMeta prop added so you can include additional metadata that needs to be sent along. This prop can be in the form of a string, array or object and empty postMeta data is not sent. To pass a string use :postMeta="'string'", to include an array you should use :postMeta="['value']" and for an object use :postMeta="{name: 'value'}".

Install

npm i @updivision/vue2-multi-uploader

ES6

    import MultipleFileUploader from '@updivision/vue2-multi-uploader'
    export default {
        ...
        components: {
            MultipleFileUploader
        },
        ...
    }

Props

Prop name Type Required Default
postURL String yes -
successMessagePath String yes -
errorMessagePath String yes -
minItems Number no 1
maxItems Number no 30
method String no POST
postMeta String, Array, Object no -
postData Object no -
showHttpMessages Boolean no true
postHeader Object no null

Message Props

All text in the component is also configurable. Below is the list of available props that can be configured, if necessary. Default values are provided for each prop.

Prop name Type Required Default
headerMessage String no Add files
dropAreaPrimaryMessage String no Drop multiple files here.
dropAreaSecondaryMessage String no or click to upload
fileNameMessage String no Names
fileSizeMessage String no Sizes
totalFileMessage String no Total files:
totalUploadSizeMessage String no Total upload size:
removeFileMessage String no Remove files
uploadButtonMessage String no Upload
cancelButtonMessage String no Cancel
fileUploadErrorMessage String no An error has occurred
minFilesErrorMessage String no Minimum files that need to be added to uploader
maxFilesErrorMessage String no Maximum files that can be added to uploader
retryErrorMessage String no Please remove the files and try again.
httpMethodErrorMessage String no This HTTP method is not allowed. Please use either 'put' or 'post' methods.

postURL

Set your POST url in the postURL prop.

JSON Responses

Set JSON success and error response messages to your custom JSON responses via props: successMessagePath, errorMessagePath

Example template to use:

<multiple-file-uploader postURL="http://.." successMessagePath="" errorMessagePath=""></multiple-file-uploader>

Minimum items to upload (optional) You can modify the minimum number of files required for the upload to take place by changing the value of minItems prop. Default is set to 1. Here is an example template for uploading a minimum of 5 items and a maximum of 10 items:

<multiple-file-uploader postURL="http://.." successMessagePath="" errorMessagePath="" :minItems="5" :maxItems="10"></multiple-file-uploader>

Events

Fires upload-success or upload-error respectively. Success handler receives axios response object. Error handler receives axios error object.

<multiple-file-uploader postURL="http://.." successMessagePath="" errorMessagePath="" @upload-success='success_handler'></multiple-file-uploader>
	...
	success_handler: function(response){

	},
	...

Dependencies

Axios, ES6-Promise

CSS

CSS style is not scoped so it's easy for you to overwrite your own style. Bootstrap CSS is used in demo but not required for the component.

Class dropAreaDragging is active for giving some user feedback. Example:

.dropAreaDragging{
   background-color:#ccc;
}

LICENSE


The MIT License (MIT)

Copyright (c) 2018 UPDIVISION

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].