Upload Base64 Image Facebook Graph API

前端 未结 7 2253
礼貌的吻别
礼貌的吻别 2020-11-28 06:06

I\'m trying to upload a base64 image to a FaceBook page using Node.js. I have managed to get the upload working with all the multipart data etc should I read the file from t

7条回答
  •  长情又很酷
    2020-11-28 06:27

    We can simplify image recoding by usage of the modern Fetch API instead of Uint8Array.

     var url = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="
    
     fetch(url)
      .then(res => res.blob())
      .then(blob => console.log(blob))`
    

提交回复
热议问题