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
- Realtime api and labels as permission
in my tables i set labels as permission and real-time capabilities stopped working. Before when i was having "any" role everything was working. Note: user have...
- how to access the value of account statu...
- Redirect from clicking team invite link ...
Hi all! Pretty new to app development in general so this might be something more generic than appwrite, but I've found (after reading the docs for the Teams API...