从谷歌浏览器下载文件时发生网络错误我可以使用Mozilla、InternetExplorer下载文件,但这不适用于GoogleChrome。字符串base64FileString=结果;byte[]binaryFile=Convert.FromBase64String(base64FileString);Response.ContentType="application/octet-stream";Response.AddHeader("content-disposition",String.Format("attachment;filename="{0}"",Request.QueryString["FILENAME"]));Response.Clear();Response.BufferOutput=false;Response.ClearContent();Response.BinaryWrite(binaryFile);响应.Flush();Response.Close();谁能帮我下载我需要在Chrome中进行的更改如果“application/octet-stream”是您对表单的回复,GoogleChrome将无法为您打开“文件保存”窗口。如果您知道,Content-Type应该是已知的内容类型。例如“application/pdf”、“image/png”或其他。查看完整的MIME类型列表查看此问题什么可以阻止Chrome下载文件?了解更多信息。以上是C#学习教程:谷歌浏览器下载文件时出现网络错误。分享的全部内容,如果对大家有用,需要进一步了解C#学习教程,希望大家多多关注。本文收集自网络,不代表立场。如涉及侵权,请点击右侧联系管理员删除。如需转载请注明出处:
