For anyone using NodeBB to upload a screenshot from node.js
const buffer = await createImage({ path: `screenshot/annotation:${ annotationID }` , encoding: 'binary' }) const result = await rp({ url: `${ endpoint }/util/upload?_uid=${ _uid }`, method: 'POST', json: true, headers: { Authorization , 'Content-Type': 'multipart/form-data' }, formData: { 'files[]': { value: buffer, options: { filename: `annotaion-${ annotationID }.jpg`, contentType: 'image/jpg' } } }, })error when resetting plugin
-
./nodebb reset plugin
/opt/nodebb/node_modules/mongodb/lib/utils.js:98
process.nextTick(function() { throw err; });
^TypeError: invalid data
at WriteStream.Socket.write (net.js:617:11)
at /opt/nodebb/src/reset.js:57:19
at /opt/nodebb/src/database/mongo.js:108:6
at /opt/nodebb/node_modules/mongodb/lib/db.js:1553:5
at handleCallback (/opt/nodebb/node_modules/mongodb/lib/utils.js:95:56)
at _callback (/opt/nodebb/node_modules/mongodb/lib/db.js:1469:5)
at /opt/nodebb/node_modules/mongodb/lib/db.js:1512:7
at /opt/nodebb/node_modules/mongodb-core/lib/connection/pool.js:724:7
at /opt/nodebb/node_modules/mongodb-core/lib/connection/pool.js:702:11
at finish (/opt/nodebb/node_modules/mongodb-core/lib/auth/scram.js:160:16)