我正在向浏览器发送文件以便在本地保存.这适用于除Microsoft Edge之外的所有浏览器,它使用guid替换文件名.必须使用特定文件名下载该文件,是否有针对此问题的解释或解决方法?我的回答“不使用Edge”将被拒绝.
var response = new HttpResponseMessage(HttpStatusCode.OK) { Content = new ByteArrayContent(CreateFile(fileContents)) }; response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); response.Content.Headers.Contentdisposition = new ContentdispositionHeaderValue("attachment") { FileName = string.Concat(fileName,".xlsx") };
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。