我正在尝试将结果从nativescript-mediafilepicker转换为bytea,以将其存储到postgres数据库表的字段中。选择的结果是:
我已经测试了“ image-source”中的loadFromData和fromData方法,也无法对其进行解码。
0: {
JS: "type": "image",
JS: "file": "/storage/emulated/0/Pictures/facebook/FB_IMG_15599124283098587.jpg",
JS: "rawData": {}
JS: }
当我打印“ rawData”时,我得到了:
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
它正在很好地插入数据库中,但是我知道这是行不通的,因为当我尝试从程序中查看图像时,我无法看到它,其格式已损坏,并且当我从Webapp(JSP)中执行操作时它存储它并显示出魅力。