Skip to content

Firefox throws allocation size overflow when selecting large files #40

@avivace

Description

@avivace

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

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions