Bug: Unable to upload pdf using data key.
var pdf = fs.readFileSync("/Users/yyy/Downloads/xxx.pdf, { encoding: "base64" }); var r = await swell.put('/accounts/xxxx', { content : { proof_of_business: { file : { content_type: "application/pdf", filename: "some file.pdf", data: { $binary: pdf, $type: "00" } } } }
This does not work. Error
Error: Object fields contain "$" or "." and are not valid for storage. (cmd: "update", query: {"query":{"_idโ:โxxxโ},โupdate":{"$set":{"content":{"proof_of_business":{"idโ:โxxxโ,โlength":31,"date_uploaded":"2022-06-22T06:16:47.588Z","content_type":"binary/octet-stream","md5โ:โyyyโ,โurl":"https://cdn.schema.io/yyyโ,โfile":{"content_type":"application/pdf","filename":"some file.pdf","url":"file:////Users/yyy/Downloads/xxxโ.pdf,โdata":{"$binary":"JVBERi0xLjMKJeLjz9โฆ.
0
Comments
-
Addendum:
Upon upload, the field looks like the following in Swell entity
If one tries to download and open it, it appears as
0