如何上传大(大于25MB)文件添加到Web服务? [英] How do I upload large (> 25MB) files to a web service?
问题描述
我有一个Web服务,它需要一个byte [],并将其保存。
I have a web service that takes a byte[] and saves it.
这很好地满足小文件,但一旦我打了一定规模的网络服务将失败并返回请求失败,HTTP状态404:未找到
This works fine for "small" files, but once I hit a certain size the web service fails and returns "The request failed with HTTP status 404: Not Found."
这是我所看到的,这似乎是一个能够限制发布(以prevent拒绝服务攻击)的文件大小的IIS设置。我试图提高该设置,但我无法确定什么设置,并在那里/如何能设置。我使用IIS7和web服务是.NET(ASMX)来实现。
From what I've seen this appears to be an IIS setting that limits the size of a file that can be posted (to prevent Denial of Service attacks). I've tried to increase that setting, but I am having trouble determining what setting and where/how one would set it. I am using IIS7 and the webservice is done in .net (asmx).
在Web服务我已经加入以下(这似乎增加文件的大小是可以接受的,但并不是所有的方法来此设置大小)的web.config文件
In the web.config of the web service I have added the following (which seemed to increase the size of file that can be accepted, but not all the way to this setting size)
<system.web>
<httpRuntime executionTimeout="999999" maxRequestLength="2097151" />
...
</system.web>
在哪里(以及如何)提高文件的大小,该Web服务将大大AP preciated任何建议。
Any suggestions on where (and how) to increase the size of file that the web service would be greatly appreciated.
推荐答案
在除的httpRuntime / maxRequestLength的问题中所提到的,它看起来像有可以添加到Web服务的web.config文件中追加项目允许大型文件传输。
In addition to the httpRuntime/maxRequestLength mentioned in the question, it looks like there is an additional item that can be added to the web service's web.config file to permit large file transfers.
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2000000000" />
</requestFiltering>
</security>
</system.webServer>
这似乎使较大的文件,以通过Web服务进行上传。
This appears to enable larger files to be uploaded via web services.
这篇关于如何上传大(大于25MB)文件添加到Web服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!