Convert Base64 image to raw binary with Node.js

前端 未结 2 1113
北荒
北荒 2021-02-14 12:42

I have found posts that are close to what I\'m looking for, but I have not been able to successfully implement what I want. Here is the general flow:

  1. Submit photo
2条回答
  •  被撕碎了的回忆
    2021-02-14 13:21

    Make sure your string is correct. This worked for me..

    var buf = new Buffer(b64stringhere, 'base64');
    var express = require('express'), app = express();
    app.get('/img', function(r, s){
        s.end(buf);
    })
    app.listen(80);
    

提交回复
热议问题