(gears 0.5.4) creating a blob object in javascript

13 views
Skip to first unread message

dviner

unread,
Dec 17, 2008, 12:44:32 PM12/17/08
to Gears Users
Is there a way to create a GearsBlob object from a javascript variable
within javascript?

I have a bytearray that is constructed in javascript, and want to
store it into my localstore using captureAsBlob... but that interface
appears to require a Blob object, not just a bytearray.

Thanks
Dave

Andrei Popescu

unread,
Dec 17, 2008, 3:00:22 PM12/17/08
to Gears Users
Is there any particular reason why you want to store it in the
LocalServer? You could store it in a database instead.

Andrei

dviner

unread,
Dec 17, 2008, 6:20:13 PM12/17/08
to Gears Users
HI Andrei,

I suppose that a Database could work as well. I imagine that I would
store my bytearray as a Blob into the GearsDatabase and then access it
using the standard sqlite result set. Does the blob datatype allow
for binary data? Does accessing it via the ResultSet maintain the
binary representation?

Thanks
Dave


On Dec 17, 12:00 pm, Andrei Popescu <gears.team.andr...@gmail.com>
wrote:

Lenbok

unread,
Dec 21, 2008, 7:49:31 PM12/21/08
to Gears Users


On Dec 18, 9:00 am, Andrei Popescu <gears.team.andr...@gmail.com>
wrote:
> Is there any particular reason why you want to store it in the
> LocalServer? You could store it in a database instead.

My use case (posted here a couple of months ago) is to generate a pdf
report while offline, and then serve that to the user. In order to do
that, we need to be able to put it in the local store, it is not
sufficient to store it in the database.

Cheers,
Len.
Reply all
Reply to author
Forward
0 new messages