#Meyer - Identity File Upload
1 messages · Page 1 of 1 (latest)
Hello Rubeus !
yes
in the example we just have local file but not with a url existing
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.
Indeed what I saw on the doc but can you explain me how to do in NodeJS please?
Do what exactly? Which part?
transform a URL from local file source for upload to stripe
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.
do you have a screen for see that ?
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
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 ^^
👍 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
What does your code for uploading the file to us look like?
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
Why are the names of the files ending in .jpg but the type is image/png?
i tried to rename name to frontfile or frontfile.png and is the same result
gotcha
haahaa
and what does your code for generating s3Front and s3Back look like?
i see a issue in github but is not resovled so ...
s3front and s3back is just url like : https://s3.fr-par.scw.cloud/werent-dev/identity/3vaCEVuaRLqoxQOWTWZ3J46lp3B0iEmtEtdAYRFKKaj7rZyAuXYmsXpjPAX6m4PA.png
Wait - are you saying s3front and s3back are just strings that point to s3 URLs?
yes