Hello, if I upload an image using the .NET SDK, the mimetype for my png images is set to "application/octet-stream" instead of "image/png".
This is my code
TypeScript
```public async Task<string> CreateFileAsync(string bucketId, string filename, string content, string mimeType)
{
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(content));
var inputFile = InputFile.FromStream(stream, filename.ToLower(), mimeType);
var fileId = ID.Unique();
inputFile.Path=filename.ToLower();
try
{
var fileToWrite = await _storage.CreateFile(bucketId, fileId, inputFile, new List<string>());
return fileToWrite.Id;
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
return "";
}```
I added "inputFile.Path=filename.ToLower();" just in case but no difference. What could be the problem?
selfhosted Appwrite Version: 1.4.13 Appwrite Nuget: 0.7.1
TL;DR
Issue with image mime type when uploading in .NET SDK. The problem might be caused by the ".ToLower()" method. Try using a different approach.Recommended threads
- Getting this error when creating a websi...
when I visit the site I get 404, even if the deployment is successfull
- Error updating attribute in table with r...
I have two tables with a bidirectional relationship attribute, one called "amenities" and the other "reservations". When I try to update a field called "pricePe...
- Google's "Choose an account" screen stuc...
I've been struggling with this problem on my servers (self hosted 1.6.0 & 1.7.4) , multiple projects , multiple apps , and I think I have reached a very strange...