有没有办法将结果从“转换”中转换过来;nativescript mediafilepicker“;选择字节[]以按TEA类型将其保存到Postgres数据库字段中?

有没有办法将结果从“转换”中转换过来;nativescript mediafilepicker“;选择字节[]以按TEA类型将其保存到Postgres数据库字段中?,nativescript,Nativescript,我正在尝试将nativescript mediafilepicker的结果转换为bytea,以便将其存储到postgres数据库表中的字段中。拾取的结果是: 我测试了loadFromData,来自“图像源”的fromData方法来解码它,但什么都没有 0: { JS: "type": "image", JS: "file": "/storage/emulated/0/Pictures/facebook/FB_IMG_15599124283098587.jpg", JS: "rawDa

我正在尝试将nativescript mediafilepicker的结果转换为bytea,以便将其存储到postgres数据库表中的字段中。拾取的结果是:

我测试了loadFromData,来自“图像源”的fromData方法来解码它,但什么都没有

0: {
JS:   "type": "image",
JS:   "file": "/storage/emulated/0/Pictures/facebook/FB_IMG_15599124283098587.jpg",
JS:   "rawData": {}
JS: }
当我打印“原始数据”时,我得到以下信息:

JS: ==== object dump start ====
JS: constructor()
JS: <init>()
JS: describeContents()
JS: getOrientation()
JS: setOrientation()
JS: writeToParcel()
JS: equals()
JS: getBucketId()
JS: getBucketName()
JS: getDate()
JS: getId()
JS: getName()
JS: getPath()
JS: getSize()
JS: hashCode()
JS: isSelected()
JS: setBucketId()
JS: setBucketName()
JS: setDate()
JS: setId()
JS: setName()
JS: setPath()
JS: setSelected()
JS: setSize()
JS: clone()
JS: finalize()
JS: getClass()
JS: notify()
JS: notifyAll()
JS: toString()
JS: wait()
JS: ==== object dump end ====
JS: com.vincent.filepicker.filter.entity.ImageFile@3aee1ead
JS:==对象转储开始====
JS:constructor()
JS:()
JS:describeContents()
JS:getOrientation()
JS:setOrientation()
JS:writeToParcel()
JS:equals()
JS:getBucketId()
JS:getBucketName()
JS:getDate()
JS:getId()
JS:getName()
JS:getPath()
JS:getSize()
JS:hashCode()
JS:isSelected()
JS:setBucketId()
JS:setBucketName()
JS:setDate()
JS:setId()
JS:setName()
JS:setPath()
JS:setSelected()
JS:setSize()
JS:clone()
JS:finalize()
JS:getClass()
JS:notify()
JS:notifyAll()
JS:toString()
JS:wait()
JS:==对象转储结束====
JS:com.vincent.filepicker.filter.entity。ImageFile@3aee1ead

它很好地插入到数据库中,但我知道这不起作用,因为当我试图从我的程序中查看图像时,我看不到,它的格式已损坏,当我从我的webapp(JSP)中执行操作时,它会将其存储并显示为一种魅力。

你是说后端服务器上的postgres吗?显然,您不会从移动应用程序编写数据,您必须通过后端团队公开的一些API来编写数据。您可能会发送文件本身,而后端开发人员必须读取文件并以他想要的任何格式写入数据。您可以使用插件上传文件。啊,好的,那么从NodeJS(我的后端)我可以将其转换为bytea吗?您是对的,我正在尝试从设备转换。如何将图像转换为base64编码并存储生成的字符串?