#Baz-filelink-extension
1 messages ยท Page 1 of 1 (latest)
Hello ๐
I'm not sure if there's a way to add in an extension ๐ฆ Let me double check
yeah don't think there's a workaround here unfortunately ๐ฆ
I must be missing something? What use is the ability to download files if you can't tell what format it is or you can't open it?
ah sorry my bad
there's a way to know the type (extension) of the file but I don't know how that'd work with the browser
When you retrieve the file link, you can expand the file parameter
https://stripe.com/docs/api/file_links/object#file_link_object-file
The file object should have a type listed
https://stripe.com/docs/api/files/object#file_object-type
I see
Thanks
Kinda sucks though - as you need a whole new API request just to get this
If I remember correctly, you can pass the expand field when you create the file link so that the response would include the file object
not 100% sure as I haven't tried it myself
i tried that already, unless i'm doing it wrong
Fatal error: Uncaught Stripe\Exception\InvalidArgumentException: Got unexpected keys in options array: expand
ah, can you share the snippet?
Think I worked it out
Looks like you can expand to include the file object
But I've just tried it in live mode, and the file download includes the extension when the browser goes to save it
It may just be that the test files created by Stripe identity in test mode have that issue
Though I can see they are png's from the file header and also the type in the file object