All Projects → dhhb → vue-base64-file-upload

dhhb / vue-base64-file-upload

Licence: other
Upload files as base64 data-uris

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to vue-base64-file-upload

blur-up
A tool that creates preview images.
Stars: ✭ 28 (-63.64%)
Mutual labels:  base64, data-uri
vue-datatables
No description or website provided.
Stars: ✭ 22 (-71.43%)
Mutual labels:  vue-components
hawkvuemdframework
Vue material Framework. Lightweight components for vuejs 2.x.
Stars: ✭ 15 (-80.52%)
Mutual labels:  vue-components
python-datauri
Data URI manipulation made easy.
Stars: ✭ 29 (-62.34%)
Mutual labels:  data-uri
parcel-plugin-url-loader
📦url loader for parcel, use base64 encode file
Stars: ✭ 24 (-68.83%)
Mutual labels:  base64
v-markdown-editor
Vue.js Markdown Editor component
Stars: ✭ 101 (+31.17%)
Mutual labels:  vue-components
vue-today
📅 Today is cute
Stars: ✭ 37 (-51.95%)
Mutual labels:  vue-components
vue-flag-icon
a vue compoment for flag-icon-css
Stars: ✭ 64 (-16.88%)
Mutual labels:  vue-components
nuxewind
Free Vue JS (Nuxt 2) Tailwind Admin Dashboard Template
Stars: ✭ 62 (-19.48%)
Mutual labels:  vue-components
react-file-input-previews-base64
This package provides an easy to use, ready to go and customizable wrapper around file input, with option for image previews and returning file as base64 string.
Stars: ✭ 15 (-80.52%)
Mutual labels:  base64
v-intl
Add i18n to your awesome Vue 3 app 🔉
Stars: ✭ 13 (-83.12%)
Mutual labels:  vue-components
go-checksum
Simple tool to calc Golang module checksum of go.mod and module dir.
Stars: ✭ 45 (-41.56%)
Mutual labels:  base64
vueface
UI Components for Vue
Stars: ✭ 74 (-3.9%)
Mutual labels:  vue-components
vue-component-creater-ui
拖拽式Vue组件代码生成编辑器(VCC)
Stars: ✭ 383 (+397.4%)
Mutual labels:  vue-components
vue-frame
Dynamic component for creation of interfaces with iframes
Stars: ✭ 47 (-38.96%)
Mutual labels:  vue-components
convey
CSV processing and web related data types mutual conversion
Stars: ✭ 16 (-79.22%)
Mutual labels:  base64
BaseNcoding
Library for encoding of binary data into strings using base32, base85, base128 and other algorithms.
Stars: ✭ 42 (-45.45%)
Mutual labels:  base64
vue-masonry-gallery
Masonry gallery layout component for Vue.js
Stars: ✭ 35 (-54.55%)
Mutual labels:  vue-components
vue-data-table
Smart table using vue.js - sorting columns, filter by string, child rows, custom columns, custom row data
Stars: ✭ 15 (-80.52%)
Mutual labels:  vue-components
google-drive-direct-remote-upload
Directly upload files from the web to Google Drive without saving them completely on the server before.
Stars: ✭ 62 (-19.48%)
Mutual labels:  file-upload

vue-base64-file-upload

Upload files as base64 data-uris (URL representing the file's data as a base64 encoded string).

Install

npm i vue-base64-file-upload --save

Example

import Vue from 'vue';
import VueBase64FileUpload from 'vue-base64-file-upload';

const app = new Vue({
  components: {
    VueBase64FileUpload
  },

  data() {
    return {
      customImageMaxSize: 3 // megabytes
    };
  },

  methods: {
    onFile(file) {
      console.log(file); // file object
    },

    onLoad(dataUri) {
      console.log(dataUri); // data-uri string
    },

    onSizeExceeded(size) {
      alert(`Image ${size}Mb size exceeds limits of ${this.customImageMaxSize}Mb!`);
    }
  },

  template: `
    <div class="container">
      <h2>Upload file</h2>
      <vue-base64-file-upload 
        class="v1"
        accept="image/png,image/jpeg"
        image-class="v1-image"
        input-class="v1-input"
        :max-size="customImageMaxSize"
        @size-exceeded="onSizeExceeded"
        @file="onFile"
        @load="onLoad" />
    </div>
  `
});

app.$mount('#app');

API

Props

  • image-class - pass additional classes for preview img tag
  • input-class - pass additional classes for text input tag
  • accept - mimetypes allowed for upload, defaults to 'image/png,image/gif,image/jpeg'
  • max-size - number of megabytes allowed for upload, defaults to 10
  • disable-preview - not show preview image, defaults to false
  • default-preview - pass url or data-uri to be displayed as default image
  • file-name - pass custom filename to be displayed in text input tag
  • placeholder - pass placeholder text for text input tag

Events

  • file - fired when file object is ready
  • load - fired when data-uri is ready
  • size-exceeded - fired if uploaded image size exceeds limits

References


MIT Licensed

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].