Convert Blob data to Raw buffer in javascript or node

后端 未结 3 1364
猫巷女王i
猫巷女王i 2021-02-09 04:55

I am using a plugin jsPDF which generates PDF and saves it to local file system. Now in jsPDF.js, there is some piece of code which generates pdf data in blob format as:-

<
3条回答
  •  情深已故
    2021-02-09 05:16

    For me, it worked with the following:

    const buffer=Buffer.from(blob,'binary');
    

    So, this buffer can be stored in Google Cloud Storage and local disk with fs node package.

    I used blob file, to send data from client to server through ddp protocol (Meteor), so, when this file arrives to server I convert it to buffer in order to store it.

提交回复
热议问题