#codecoolkid

1 messages · Page 1 of 1 (latest)

reef nightBOT
random elbow
#

Is this your backend code?

patent hawk
#

yes this is in nodejs

#

Im getting the image through URL from one of our servers with axios

random elbow
patent hawk
#

Oh perfect let me check had no idea there were logs sec

#

Interesting is not getting to the logs

#

What is file.data expecting like a buffer, base64 are this accepted?

#

oh my god I think I just made it work

#

leaving here the code for context:

const response = await axios.get(URL, { responseType: 'arraybuffer' })
const buffer = Buffer.from(response.data, "utf-8")

    var stripeFile = await stripe.files.create({
        purpose: 'identity_document',
        file: {
            data: buffer,
            name: file?.key,
            type: 'application.octet-stream',
        },
    });
random elbow
#

Interesting

#

Glad to hear you figured it out tho!

patent hawk
#

Thank you I believe the method on fetching the image wasn't expected by stripe just convert it to a buffer and worked, thanks for the logs url! Very helpful