#Meyer - Identity File Upload

1 messages · Page 1 of 1 (latest)

umbral pike
jolly river
#

Hello Rubeus !

#

yes

#

in the example we just have local file but not with a url existing

umbral pike
#

I don't believe it's possible to specify a file should be created from a URL or non-local source. You need to upload the file locally using a multipart/form-data upload.

jolly river
#

Indeed what I saw on the doc but can you explain me how to do in NodeJS please?

umbral pike
#

Do what exactly? Which part?

jolly river
#

transform a URL from local file source for upload to stripe

umbral pike
#

You would need to download the URL on your end, then use the Stripe Node library to upload it as shown in the code snippet linked above.

jolly river
#

do you have a screen for see that ?

bitter gyro
#

Are you asking for an example of how to do this? I don't think we provide any specific example, but there should be plenty of other public resources/guides for how to download a file from a URL

jolly river
#

indeed there is some, but I can't manage to upload it on stripe.

I understand that what I'm asking you is not specifically from stripe.

thanks for your help ^^

bitter gyro
#

👍 Yeah I'd start by just getting your file properly downloaded, and when you're on the Stripe-specific portion feel free to come back to us if you run into issues

jolly river
#

Let me come back to you because I have a Stripe error for this problem

bitter gyro
#

What does your code for uploading the file to us look like?

jolly river
#
 const frontFile = await stripe.files.create(
        {
          purpose: 'identity_document',
          file: {
            data: s3front,
            name: 'frontFile.jpg',
            type: 'image/png',
          },
        },
        {
          stripeAccount: userConcerned.stripe.accountId,
        },
      );
      const backFile = await stripe.files.create(
        {
          purpose: 'identity_document',
          file: {
            data: s3Back,
            name: 'backFile.jpg',
            type: 'image/png',
          },
        },
        {
          stripeAccount: userConcerned.stripe.accountId,
        },
      );

      console.log(backFile);
      await stripe.accounts.update(userConcerned.stripe.accountId, {
        individual: {
          verification: {
            document: {
              front: frontFile.id,
              back: backFile.id,
            },
          },
        },
      });
#

s3front, s3back is url

bitter gyro
#

Why are the names of the files ending in .jpg but the type is image/png?

jolly river
#

i tried to rename name to frontfile or frontfile.png and is the same result

bitter gyro
#

gotcha

jolly river
#

haahaa

bitter gyro
#

and what does your code for generating s3Front and s3Back look like?

jolly river
#

i see a issue in github but is not resovled so ...

bitter gyro
#

Wait - are you saying s3front and s3back are just strings that point to s3 URLs?

jolly river
#

yes