Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- downloadFile:function(obj){
- API.get('/file/'+obj.hash, {
- responseType: 'blob',
- }
- )
- .then((response) => {
- var fileURL = window.URL.createObjectURL(new Blob([response.data]));
- var fileLink = document.createElement('a');
- fileLink.href = fileURL;
- fileLink.setAttribute('download', obj.name);
- document.body.appendChild(fileLink);
- fileLink.click();
- });
- window.console.log(obj);
- }
Add Comment
Please, Sign In to add comment