c# - 无法使用 https 下载 excel 文件
问题描述
我在 ASP.NET Core 中编写了一个 api,用于下载 excel 文件。我的代码是 -
[Route("api/[controller]")]
[ApiController]
public class ReportController : ControllerBase {
[HttpGet]
[Route("GetReport")]
public async Task<IActionResult> GetReport(string itemKey = "", bool detailed = false, CancellationToken ct = default)
{
var stream = await _logic.PerpetualDiscrepencyReport(itemKey, detailed, ct);
return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Report.xlsx");
}
}
在本地,我可以使用 http 和 https 访问 url 和下载报告。但是在暂存(IIS 服务器)中,我无法使用 https 访问报告 url。如果我使用 http,我可以通过点击 url 来下载报告。我应该在 iis 配置中做任何事情以能够使用 https 获取报告吗?其他 api 在 https 上运行良好。
解决方案
推荐阅读
- oauth-2.0 - Google OAuth 授权多人在一个脚本中
- amazon-web-services - Aws Appsync $util.error:数据和 errorInfo 始终为空
- mysql - 对连接语句的结果运行查询
- spring-boot - Keycloak Spring Boot 微服务
- powershell - PowerShell Active Directory 对象可写属性
- node.js - 当新属性大于原始属性时,使用 aws sdk for javascript 在 DynamoDB 中编写条件表达式
- python - ImportError:没有名为 Tkinter 的模块
- mysql - 限制器澄清 MySQL
- amazon-web-services - ECS awslogs 的工作原理
- html - CSS 表格单元格内容不在顶部