【发布时间】:2020-03-17 09:20:07
【问题描述】:
如果文件名中没有扩展名,那么我无法获取contentType 来创建FileStreamResult。
示例:
byte[] byteFile = await someDirectory.GetFileContentAsync(fileName);
string contentType;
new FileExtensionContentTypeProvider().TryGetContentType(fileName, out contentType); // fileName without extension
return (byteFile, contentType); // contentType == null
有没有办法不从名称中获取扩展名?
【问题讨论】:
-
您想获得 azure blob 文件扩展名吗?