Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
vue-file-agent
Advanced tools
High performant Vue file upload component with elegant and distinguishable previews for every file type and support for drag and drop, validations, default uploader with progress support and externally customizable in the "vue way"
Every file deserves to be treated equally
High performant Vue file upload component with elegant and distinguishable previews for every file type and support for drag and drop, validations, default uploader with progress support and externally customizable in the "vue way"
:editable
prop:sortable
prop:resumable
prop through tus.io protocol<template>
<VueFileAgent :uploadUrl="uploadUrl" v-model="fileRecords"></VueFileAgent>
</template>
NOTE: when uploadUrl
is provided, auto uploading is enabled. See Advanced Usage section below for manual uploading example.
<script>
export default {
data() {
return {
// ...
fileRecords: [],
uploadUrl: 'https://example.com',
// ...
};
},
// ...
};
</script>
Yes. That's it. It's that simple. See Advanced Usage section below to tailor it for your specific needs.
npm install vue-file-agent --save
import Vue from 'vue';
import VueFileAgent from 'vue-file-agent';
import VueFileAgentStyles from 'vue-file-agent/dist/vue-file-agent.css';
Vue.use(VueFileAgent);
or with script tag
<!-- jsdelivr cdn -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vue-file-agent@latest/dist/vue-file-agent.css" />
<script src="https://cdn.jsdelivr.net/npm/vue-file-agent@latest/dist/vue-file-agent.umd.js"></script>
<!-- unpkg -->
<link rel="stylesheet" href="https://unpkg.com/vue-file-agent@latest/dist/vue-file-agent.css" />
<script src="https://unpkg.com/vue-file-agent@latest/dist/vue-file-agent.umd.js"></script>
<template>
<VueFileAgent
ref="vueFileAgent"
:theme="'list'"
:multiple="true"
:deletable="true"
:meta="true"
:accept="'image/*,.zip'"
:maxSize="'10MB'"
:maxFiles="14"
:helpText="'Choose images or zip files'"
:errorText="{
type: 'Invalid file type. Only images or zip Allowed',
size: 'Files should not exceed 10MB in size',
}"
@select="filesSelected($event)"
@beforedelete="onBeforeDelete($event)"
@delete="fileDeleted($event)"
v-model="fileRecords"
></VueFileAgent>
<button :disabled="!fileRecordsForUpload.length" @click="uploadFiles()">
Upload {{ fileRecordsForUpload.length }} files
</button>
</template>
<script>
export default {
data: function () {
return {
fileRecords: [],
uploadUrl: 'https://www.mocky.io/v2/5d4fb20b3000005c111099e3',
uploadHeaders: { 'X-Test-Header': 'vue-file-agent' },
fileRecordsForUpload: [],
};
},
methods: {
uploadFiles: function () {
// Using the default uploader. You may use another uploader instead.
this.$refs.vueFileAgent.upload(this.uploadUrl, this.uploadHeaders, this.fileRecordsForUpload);
this.fileRecordsForUpload = [];
},
deleteUploadedFile: function (fileRecord) {
// Using the default uploader. You may use another uploader instead.
this.$refs.vueFileAgent.deleteUpload(this.uploadUrl, this.uploadHeaders, fileRecord);
},
filesSelected: function (fileRecordsNewlySelected) {
var validFileRecords = fileRecordsNewlySelected.filter((fileRecord) => !fileRecord.error);
this.fileRecordsForUpload = this.fileRecordsForUpload.concat(validFileRecords);
},
onBeforeDelete: function (fileRecord) {
var i = this.fileRecordsForUpload.indexOf(fileRecord);
if (i !== -1) {
this.fileRecordsForUpload.splice(i, 1);
} else {
if (confirm('Are you sure you want to delete?')) {
this.$refs.vueFileAgent.deleteFileRecord(fileRecord); // will trigger 'delete' event
}
}
},
fileDeleted: function (fileRecord) {
var i = this.fileRecordsForUpload.indexOf(fileRecord);
if (i !== -1) {
this.fileRecordsForUpload.splice(i, 1);
} else {
this.deleteUploadedFile(fileRecord);
}
},
},
};
</script>
The MIT License
FAQs
High performant Vue file upload component with elegant and distinguishable previews for every file type and support for drag and drop, validations, default uploader with progress support and externally customizable in the "vue way"
The npm package vue-file-agent receives a total of 3,905 weekly downloads. As such, vue-file-agent popularity was classified as popular.
We found that vue-file-agent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.