You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

59 lines
1.3 KiB

<urban-filemanager-upload>
<div class="file-upload">
<div class="file-upload">
<form onsubmit={ } enctype="multipart/form-data">
<input name="files[]" type="file" multiple onchange={ handleChange }>
</form>
<div class="file-upload__item" each={ file in state.files }>
{ file.name } / { file.size }
</div>
</div>
</div>
<script>
/**
*
* parent Directory
*
*
*
*/
export default {
state: {
files: []
},
/**
*
*
* @param Object event
*
*/
handleChange(event) {
console.log(event.target.files)
this.state.files = event.target.files
this.update()
}
handleUpload(event) {
const config = {
onUploadProgress: progressEvent => console.log(progressEvent.loaded)
}
axios.post('/api/upload/' + id, formData, config)
.then(function (response) {
currentObj.success = response.data.success;
})
.catch(function (error) {
currentObj.output = error;
})
}
}
</script>
</urban-filemanager-upload>