#NeatFastro - Error

1 messages ยท Page 1 of 1 (latest)

stray fog
#

Hi could you please be more specific?

dusky surge
#

you can take a peek at the thread I mentioned but here's the summary:

#

I wan't to upload files to stripe using flutter app

#

the stripe flutter sdk does not has file upload functionality yet

stray fog
#

The thread is showing as "cannot be loaded"

dusky surge
#

so my best bet is to either use the nodejs sdk or use the http api

#

I wasn't able to make the nodejs work as well

#

but the api is also throwing an error (see the screenshot)

dusky surge
stray fog
#

Yeah, we do ๐Ÿ™‚

#

Okay can you share a request ID for one of the failed curl requests?

#

Although file uploads via cURL are problematic

dusky surge
#

req_jGolnIGoxAbaAq

#

above is the request ID for one of the failed cURL request

stray fog
#

The file path is being passed as a string, that's the problem

dusky surge
#

also what's the matter of @ symbol in the docs?

stray fog
#

I think if you don't put the @ then it will treat what you put there as a normal string but this could also depend on what version of bash or zsh you us

#

Which is one more reason not to use curl

dusky surge
#

It's not like I want to... I don't have a choice

#

also the actual app will have to somehow provide the bytes data

stray fog
#

You really should be uploading from your server, it's more secure and you can use the Stripe NodeJS SDK

#

Well not more secure

#

but we don't have any support for it

#

Step 1 - try doing this in the browser rather than curl

dusky surge
#

worked in the browser

stray fog
#

Alright, well there we go. It's easier to send multi-part form data in the browser than configuring it via curl

dusky surge
#

ok but one problem, I can't see the log in the stripe dashboard, I did changed the publishable_key of the linked code you sent

maiden sleet
#

not sure what you mean

#

was the file uploaded? Can you retrieve via the API? If so it's working right?

dusky surge
#

I can't see the logs for the request

maiden sleet
#

do you have the file id?

dusky surge
#

yep I do, but when I tried to retrieve the file using cURL... well see the screenShot

maiden sleet
#

what's the file id though?

#

screenshots of code is not really helpful

dusky surge
#

file_1Kw8ns2eZvKYlo2CgctNZlgm

maiden sleet
#

that was created with the wrong API key

#

that's Stripe's default key, not your own key/account

dusky surge
#

you can see in the screenshot (just below the terminal window)

maiden sleet
#

you didn't though

dusky surge
#

Ok my bad, I needed to press cmd + s after replacing the key to make it work

maiden sleet
#

or you didn't reload the page and such yeah

#

it's just a simple jsfiddle example, for your to then write your own code/file upload

maiden sleet
#

but really I'm of the same opinion as @stray fog here, the easiest is for you to upload the file to your server (which as a developer you would be familiar with) and then you upload from the server

dusky surge
#

Is there by any chance a way to upload the file to stripe by proving file bytes data instead of file path?

maiden sleet
#

Is there by any chance a way to upload the file to stripe by proving file bytes data instead of file path?
yeah I think you're really confused here

#

the file name with the @ is purely "curl in the terminal" hack, nothing to do with how the upload really happens

#

that's why we keep saying "don't use curl"

#

at the end of the day, the file upload to our API uses multi part form upload, like any browser file upload

dusky surge
#

the curl was just for testing the api

#

anyhow thanks for the help

#

I will make the (app -> server -> stripe) work