简体   繁体   English

未记录的类型错误:在 swagger (.net core 3.1) 上上传文件时无法获取

[英]Undocumented TypeError: Failed to fetch when uploading file on swagger (.net core 3.1)

I am facing this error when I am trying to upload excel file (length around 4 MB) on swagger api (.Net core 3.1).当我尝试在 swagger api (.Net core 3.1) 上上传 excel 文件(长度约为 4 MB)时,我遇到了这个错误。 Its working on local as well as on other Azure app services (azure.net) but when I am trying to configure my code on azure virtual machine IIS, this error is coming on the domain api.它在本地以及其他 Azure 应用程序服务 (azure.net) 上工作,但是当我尝试在 azure 虚拟机 IIS 上配置我的代码时,此错误出现在域 api 上。

I tried lot of things adding headers, allowing CORS, increasing maxuploadlength, enabling SSL but nothing seems work.我尝试了很多添加标题的方法,允许 CORS,增加 maxuploadlength,启用 SSL,但似乎没有任何效果。 Mainly its occurring on application configured on a azure VM IIS server with SSL domain.它主要发生在配置在具有 SSL 域的 azure VM IIS 服务器上的应用程序上。

在此处输入图像描述

在此处输入图像描述

Please check if any below points are the cause.请检查是否有以下几点原因。

  1. This may happen with windows os version compatibility with the sdks.Try upgrading or downgrading visual studio. windows 操作系统版本与 sdks 的兼容性可能会发生这种情况。尝试升级或降级 visual studio。 HTTP/2 is supported with ASP.NET Core in the following IIS deployment scenarios:在以下 IIS 部署场景中,ASP.NET Core 支持 HTTP/2:

a) Windows Server 2016 or later / Windows 10 or later b) IIS 10 or later c) TLS 1.2 or later connection a) Windows Server 2016 或更高版本 / Windows 10 或更高版本 b) IIS 10 或更高版本 c) TLS 1.2 或更高版本连接

  1. Update the Chrome browser to the latest version that's compatible with your operating system, clearing cache and cookies, restart the laptop and start visual studio or the IDE again else Try uninstall any updates将 Chrome 浏览器更新到与您的操作系统兼容的最新版本,清除缓存和 cookies,重新启动笔记本电脑并再次启动 visual studio 或 IDE 否则尝试卸载任何更新
  2. Please make sure SSL certificate is trusted and enabled TLS 1.2请确保 SSL 证书受信任并启用 TLS 1.2
  3. Please check if Web Application Firewall is enabled for your app.请检查您的应用是否开启了Web应用防火墙。 and check for file upload limit field is specified.It controls the maximum allowed file upload size and can have a minimum value of 1 MB.并检查指定的文件上传限制字段。它控制允许的最大文件上传大小,最小值为 1 MB。 See Web application firewall request size limits请参阅Web 应用程序防火墙请求大小限制
  4. See if Azure virtual machine is running the supported version of the operating system that is required.查看 Azure 虚拟机是否正在运行所需的受支持版本的操作系统。

References:参考:

  1. JsonSerializerOptions.MaxDepth Property (System.Text.Json) | JsonSerializerOptions.MaxDepth 属性 (System.Text.Json) | Microsoft Docs 微软文档
  2. php - What's the.net::ERR_HTTP2_PROTOCOL_ERROR about? php - .net::ERR_HTTP2_PROTOCOL_ERROR 是关于什么的? - Stack Overflow - 堆栈溢出

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure App Service .NET Core 3.1 导出到文件异常 - Export To File Exception in Azure App Service .NET Core 3.1 .NET Core 3.1 - 组件的依赖解析失败 - AWS Mock Lambda 测试工具 - .NET Core 3.1 - Dependency resolution failed for component - AWS Mock Lambda Test Tools 在 FirebaseStorage 中上传文件时无法获取 downloadURL - Failed to get downloadURL when uploading file in FirebaseStorage 当我部署它时,.net 核心 3.1 中的 firebase 存储库在服务器上不起作用,但在本地运行良好 - firebase repository in .net core 3.1 does not work on the server when i deploy it, and works well locally 将我的 Azure Function 从 .net Core 3.1 升级到 .net Core 7.0。 错误“'无法加载文件或程序集'Microsoft.Extensions.Configuration.Abstraction - Upgrade my Azure Function from .net Core 3.1 to .net Core 7.0. Error "'Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstraction .net 核心 3.1 中的 SocketException 针对 SQS 端点,但不在 Python 或 CLI 中 - SocketException in .net core 3.1 against SQS endpoint but not in Python or CLI Service Worker - 未捕获(承诺)TypeError:无法获取 - Service Worker - Uncaught (in promise) TypeError: Failed to fetch Azure Functions in .NET Core 3.1: dependency Injection error - Azure Functions in .NET Core 3.1 : dependency Injection error HTML 在生产环境中找不到模板 .NET Core 3.1) - HTML templates could not be found in Production (NET Core 3.1) Azure AD B2C 和 Microsoft Identity Web - 使用多个策略登录 (.net Core 3.1) - Azure AD B2C & Microsoft Identity Web - Sign In with multiple policies (.net Core 3.1)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM