-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Firefox throws allocation size overflow when selecting large files, making it impossible to update with large packages (>100MB).
This also freezes for 4-5 seconds any other browser , since the entire file is read as js object..
This is how the file upload is currently handled, in Settings Vue component:
onFilePicked(e) {
const files = e.target.files
if (files[0] !== undefined) {
this.fileName = files[0].name
if (this.fileName.lastIndexOf('.') <= 0) {
return
}
const fr = new FileReader()
fr.readAsDataURL(files[0])
fr.addEventListener('load', function() {
this.fileUrl = fr.result
this.fileObj = files[0]
}.bind(this))
} else {
this.fileName = ''
this.fileObj = ''
this.fileUrl = ''
}
},
upload() {
var formdata = new FormData();
formdata.append('file_to_upload', this.fileObj)
const config = {
headers: { 'Content-Type': 'multipart/form-data' },
onUploadProgress: progressEvent => {
this.counter = Math.floor((progressEvent.loaded * 100) / progressEvent.total);
}
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working