Nowfal
Nowfal

Reputation: 93

TrueVault BLOB to file in node

How do I convert/write BLOB objects returned from truevault to files in a nodejs server.

const data = (res.blob).toString('binary')
const buf = new Buffer(data)
fs.writeFileSync("out.js", buf)

When I run this I get [object Blob] in the out.js file.

Upvotes: 0

Views: 94

Answers (1)

Manuel Wudka-Robles
Manuel Wudka-Robles

Reputation: 16

The TrueVault JS SDK doesn't currently support accessing blobs in that way from Node.js; the methods for reading the contents of blobs are intended for use in web applications. If you need to access the contents of blobs from your Node.js application, I recommend sending a feature request in their website.

Upvotes: 0

Related Questions