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 Answers1

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.

Andrew
  • 6,808
  • 3
  • 18
  • 33
Dinesh Devkota
  • 1,417
  • 2
  • 18
  • 45
  • What do you mean by 'read from my blob'? http://stackoverflow.com/questions/5682387/oracle-database-how-to-read-a-blob 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. – Dinesh Devkota Aug 22 '16 at 00:40