0

I am currently running a service on phone that will continuously retrieve and store the data into my web-sql...

However, it has since exceed 8,000 character counts and I would like to store the data into a blob file.

Is there any example available to use file-stream to store the data into a blob file and using file-reader to extract the data?

Thank you!

1 Answer 1

0

Here is an example I worked on last time to create BLOB from services and save file in text format. This directly downloads the file.

 var file = new Blob([*Yourdata*], {type: 'text/plain'});
 var timestamp = new Date().toUTCString();
 saveAs(file, "File Name " + timestamp + ".txt");

However, the first line creates the BLOB, you want and you can further process it to fit your needs. It works fine in web-view.

And here is example to read file if you want to look at it. http://plnkr.co/edit/y5n16v?p=preview

Hope this helps.

Sign up to request clarification or add additional context in comments.

1 Comment

What do you mean by 'read from my blob'? stackoverflow.com/questions/5682387/… might help you. And the URL in the answer opens up plnkr where you can see the codes to read the file from your local storage.

Your Answer

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