如何说服 chrome(browser) 显示下载文件对话框?
How to convince chrome(browser) to show the download file dialog?
如何说服 chrome(浏览器)在下载 JSON 内容时显示下载文件对话框?
使用以下 headers chrome 直接在屏幕上呈现 JSON。 Content-Type:application/json;字符集=utf-8
有什么想法吗?
事实证明,你只需要在服务器端设置内容配置,
WebOperationContext.Current.OutgoingResponse.ContentType = "application/json";
WebOperationContext.Current.OutgoingResponse.Headers.Add("Content-Disposition: attachment; filename=" + fileName + ".json");
如何说服 chrome(浏览器)在下载 JSON 内容时显示下载文件对话框?
使用以下 headers chrome 直接在屏幕上呈现 JSON。 Content-Type:application/json;字符集=utf-8
有什么想法吗?
事实证明,你只需要在服务器端设置内容配置,
WebOperationContext.Current.OutgoingResponse.ContentType = "application/json";
WebOperationContext.Current.OutgoingResponse.Headers.Add("Content-Disposition: attachment; filename=" + fileName + ".json");