博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Posting data to a HttpHandler greater then ~29MB gives a 404 error
阅读量:6786 次
发布时间:2019-06-26

本文共 1950 字,大约阅读时间需要 6 分钟。

 

1
1

I am testing a HttpHandler that accepts XML. It works fine when a small amount of data is posted but if I post data larger then approx 29mb, I get a asp.net 404 Error.

I am posting to the handler from another handler in the same project and I have tried 2 methods - 1. HttpWebRequest with "POST" 2. WebClient with UploadFile() and UploadData()

I get the same 404 error when the posted data is above 28.6 MB.

I also tried putting a breakpoint right in the beginning of the receiving handler and debugging. It is never hit. Appears like the handler was never called. Works ok for smaller sized data.

I already have the following setting. What am I doing Wrong?

EDIT: I have also tried posting to a different handler that doesnt not consume posted data, just to test, but the results are the same. Environment: Win 7, IIS 7.5, .net 3.5, VS 2008 alt text

|
 
1  
 –   
 
I already have it set way high - maxRequestLength="1048576" –   
 
Are you uploading a file or posting a page? –   
 
I have tried both uploading as a file (using Webclient) as well as posting (HttpWebRequest). the concerned data is a XML document –   

2 Answers

3
accepted

I discovered that the problem is with IIS 7 and above. It requires the max request length to be set in a different place.

See the following links -

The default value is 30000000. which is 28.6mb. The correct way to set in web.config is -

  
    
      
      
    
  

This config cleared the error I was getting. I wish the errors reported were more descriptive, at least on local machines

Does this mean that setting <httpRuntime maxRequestLength="1048576" /> is enough for IIS 6 ? (the live server is win2003)

|
 
 
Described in more detail  –   

转载于:https://www.cnblogs.com/wanxun1987/p/3311892.html

你可能感兴趣的文章
腾讯云答治茜:云计算为独角兽和传统企业提供了哪些沃土?
查看>>
Spark on YARN 部署案例
查看>>
RedHat发布JBoss 7.2,完全支持Java EE 8规范
查看>>
kubernetes1.9.2基于kubeadm的高可用安装HA
查看>>
「性能优化之道」每秒上万并发下的Spring Cloud参数优化实战
查看>>
App启动流程
查看>>
原理 | 分布式链路跟踪组件 SOFATracer 和 Zipkin 模型转换
查看>>
我的第一篇博客
查看>>
手把手教你如何用Python从PDF文件中导出数据(附链接)
查看>>
维珍银河完成最长距离火箭飞行,下一步剑指太空旅行
查看>>
[Python]attributeError:'module' object has no attribute 'dump'
查看>>
Docker系列教程11-使用Nexus管理Docker镜像
查看>>
业界最全,阿里云混合云灾备服务上线!
查看>>
Windows Linux 子系统可以在资源管理器中打开
查看>>
WebStorm文件类型关联设置
查看>>
13.1 Spring MVC 关于controller的字符编码
查看>>
理发店与 App 定价模型
查看>>
ES6(数组)
查看>>
php simplexml_load_file 函数执行不稳定
查看>>
C#,VB.NET如何将Word转换为PDF和Text
查看>>