Description
Describe the bug
When uploading a file using FileService.cs we need the ability to set the file name and content type. Currently, if you try to upload a file using the FileCreateOptions.cs class with any type of Stream other than a FileStream it will get the default file name of "blob" with a default content type.
Our use case is to allow a user to upload their dispute evidence to our application, then send the file to Stripe using a MemoryStream. The current code in this .Net library doesn't allow us to change the file name or content type in that scenario. We'd really rather not switch to FileStream since that class is meant to be used for interacting with files stored on disk, which we don't want to do.
The culprit seems to be this code:
Would it be possible to include FileName and ContentType as parameters to this class and plumb them through when uploading a file?
To Reproduce
var fileService = new FileService();
var options = new FileCreateOptions
{
File = new MemoryStream(),
Purpose = FilePurpose.DisputeEvidence
};
var uploadResult = await fileService.CreateAsync(options);
Expected behavior
We should be able to set the File name and Content Type.
Code snippets
var fileService = new FileService();
var options = new FileCreateOptions
{
File = new MemoryStream(),
Purpose = FilePurpose.DisputeEvidence
};
var uploadResult = await fileService.CreateAsync(options);
OS
Windows 10
.NET version
.Net 6.0
Library version
stripe-dotnet v39.75.1
API version
2020-08-27
Additional context
No response