Insert blob into sqlite from Safari browser using html5

I need to upload / paste a pdf file in blob in my sqlite-db, I use html5 and javascript.

I use sqlite db locally using html5 and Safari browser, I have db that is beautiful ... just need to know how to insert blob into db from pdf file on the same one, obviously, because it is a local, box.

I assume that sql will be a bit of an insertion into myblob column values ​​("/documents/myfile.pdf");

Any advice or recommendations are appreciated. Thank.

+5
source share
1 answer

PDF , FileReader File API. . http://www.html5rocks.com/en/tutorials/file/dndfiles/ .


API WebSQL , INSERT.

SQLite BLOB , x, :

INSERT INTO mytable(myblob) VALUES(x'255044462d312e340d25e2e3cfd30d0a...');
+1

All Articles