geeklearningio / gl-dotnet-storage

.NET Core Storage abstractions with FileSystem and Azure providers
MIT License
52 stars 13 forks source link

How can I store an image? #60

Closed Mikiewitch closed 7 years ago

Mikiewitch commented 7 years ago

Hello everyone, I've tried to save the image by setting the content type to image/png. The file at the disk has the type "file" though. My call looks like this: await fileStore.SaveAsync(imageBytes, "/picture", "image/png");

Any advice?

Cheers, Ondrej

sandorfr commented 7 years ago

what do you mean by has the type file?

Mikiewitch commented 7 years ago

glstorage

sandorfr commented 7 years ago

ah.. you're talking about windows explorer :). that's related to the file extension. Since you did not provide one in your path, windows does not know what it is. Metadata and Properties are emulated on File system by storing them in a .{0}-extended-properties subdirectory.

You can retrieve them later using the GetAsync api

The server middleware if you are using it will also set the response content type accordingly

Mikiewitch commented 7 years ago

Great, thank you.