简体   繁体   English

在Emberjs,Electron和PouchDB / CouchDB项目中将Blob类型的类转换为Object

[英]Class of type Blob being converted to Object in Emberjs, Electron and PouchDB/CouchDB Project

i seem to be having a funny issue here. 我似乎在这里有一个有趣的问题。 I am currently developing an offline first web application with emberjs and a desktop application wrapped in electron. 我目前正在使用emberjs开发一个离线的第一个Web应用程序,并使用电子封装一个桌面应用程序。 Both are running off a pouchdb replicating with couchdb. 两者都运行着使用ouchdb复制的pouchdb。 I noticed images uploaded on the web are only accessible there while images uploaded from the desktop app are only accessible there too. 我注意到网上上传的图像只能在此处访问,而从桌面应用程序上传的图像也只能在此处访问。 The uploaded Blob class is only seen as blob within the environment where it was uploaded. 上传的Blob类仅在上传环境中被视为Blob。 Please i really need a pointer here 请在这里我真的需要一个指针

When i access the image in a different environment this is what i see 当我在其他环境中访问图像时,这就是我看到的

content_type:"image/jpeg"
data:Object
digest:undefined
length:undefined
name:"photo_record_1.jpg"
stub:undefined
__ember1493143170849:"ember775"
__ember_meta__:Meta
__proto__:Class

When it should be 什么时候应该

__ember1493143512170:"ember788"
__ember_meta__:Meta
content_type:"image/jpeg"
data:Blob
digest:undefined
length:undefined
name:"photo_record_1.jpg"
stub:undefined
__proto__:Class

通过将图像Blob转换为base64编码并将此字符串存储在我的CouchDB中来解决此问题,不知道此实现的影响,但它解决了我的紧迫问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM