Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSQL Attachment Truncate #971

Closed
jfgirard opened this issue Oct 25, 2013 · 2 comments
Closed

WebSQL Attachment Truncate #971

jfgirard opened this issue Oct 25, 2013 · 2 comments

Comments

@jfgirard
Copy link
Contributor

Hi,
I'm very new to Pouchdb. While doing some tests, I could'nt make attachment works with Safari but it works fine on Chrome and FireFox. Both adding as a File or as a base64 string fails.

I debug the code to find out that the attachment decoded to binary string (using atob for base64 and readAsBinaryString for File).
My base64 string
R0lGODlhMAAwAPf/ANfJ…

becomes
GIF89a00÷ÿ×ɸ©]#´ ��N��C�Êu*Á…

and get inserted.

But when I grab it back, i only have GIF89a0. Most of the content is not returned.

It looks like Safari do not play well with the binary string… I changed a bit the code avoid the decoding at line 4830 //att.data = atob(att.data); and the encoding res = data;//btoa(data); to stick to base64 all the time and it works OK.

Im on OSX 10.8.5, Safari 6.1 using the latest Pouchdb-nightly.js. I also test with 10.9 with Safari 7 with the same behaviour.

Jeff

@daleharvey
Copy link
Member

Apologies for not replying for so long, closing as a dupe of https://github.com/daleharvey/pouchdb/pull/1210 though, should be fixed shortly :)

@jfgirard
Copy link
Contributor Author

Ok. I'm glad the fix is coming. Thanks, you do a great job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants