Send a file from glitch project to my bot doesn't work

So in my server:

    const blob = __dirname + '/blobs/' + name + '.png';
    fs.readFile(blob, function (err, content) {
        if (err) {
            res.writeHead(400, {'Content-type':'text/html'})
            res.end("No such image");    
        } else {

And in my bot:

request("" + args[0], function (err, res, body) {
    if (err) return

res.body gives as output, but it should be the image. ( )

res.sendFile in server also won’t fix it but also send that number image thingy.

Is this because of glitch? or is there a problem with me code?
I also tried

.use("/blob", express.static(__dirname + '/blobs/'))

and that output also gives that pastebin

Could you DM me an invite to the project.

sure, i have send it to you.

@RobinSchapendonkGame it looks like the code you were talking about it a note.

Fixed. It should work now.

1 Like