首页 > 解决方案 > 如何修复 IIS 错误(不允许使用 PUT 方法)

问题描述

我开发了一个用于服务器端渲染的 Angular Universal 应用程序。我必须在服务器中保存一个文件。该文件保存在 Angular 应用程序的文件夹中。当我构建应用程序并将其添加到 IIS 服务器时,我无法上传目录中的文件。我收到错误 PUT Method not allowed.任何帮助都会很棒!

polyfills-es2015.99fc5dde03f2933ff53f.js:1 PUT http://localhost:99/files 405(不允许的方法)

标签: angulariisserverput

解决方案


This error is caused because the WebDAV module intercepted the request.

you could try to add the below code in your site web.config file:

<system.webServer>    
  <modules>        
    <remove name="WebDAVModule" />    
  </modules>    
  <handlers>        
    <remove name="WebDAV" />    
  </handlers>
</system.webServer>

推荐阅读