5

I am looking for file saving ( in my local file system) functionality in Angular. I already gone through following modules.

Angular-file-saver

But it asked for confirmation before saving file.

I want my file to saved automatically in my local folder ( C:\MyApplication\contents)

FileSaver.saveAs(new Blob([data], { type: "video/mp4" }), 'C:\MyApplication\contents\myvideo.mp4');

Any pointers would be really helpful.

0

1 Answer 1

9

I think the best way is to handle it yourself.

Create a blob from your data.

myBlob = new Blob([new Uint8Array(myData)], {type: "octet/stream"});

Now create <a> element in the memory and click on it.

var link = document.createElement('a');
link.href = window.URL.createObjectURL(myBlob);;
link.click(); 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.