Created
June 16, 2020 03:56
-
-
Save railsstudent/b599c43a71331d6f037b022a63a9f704 to your computer and use it in GitHub Desktop.
Use FileSaver to open File object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openFile(name: string) { | |
if (this.formData[name]) { | |
const file = this.formData[name] as File | |
const { name: filename } = file | |
saveAs(file, filename); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment