Last post Jul 09, 2015 07:31 AM by bbcompent1
Jun 22, 2015 10:19 AM|usa2015usa|LINK
This question is related to my previous question.
I have published a web service application (C# built in VS2010) to a desktop with IIS 7.5 win7.
The web service has been hosted successfully.
Now I can install the application on my laptop by accessing the URL
pointing to a physical location in desktop
Now, in my application, I need to download (from C# on my laptop) a .dat file from my desktop to my local laptop by visiting the URL. The downlod function is
The URL is
But, the downloaded file size is not correct. Sometimes, it is 0. Sometimes, it is 64KB. But, the original size s 4,000 KB.
If the file size is larger than 64KB, none of them can bne downloaded. I got error:
connection was forcibly closed by remote server
on my laptop, and
error 504 gateway timeout
on my desktop.
The file is binary and is not readable in any text editor.
I have tried
but, got the same problem.
If I download the file from IE by visiting the same URL in address bar, the file can be downloaded correctly.
Why the file cannot be downloaded correctly from my application ?
Is this a bug of win 7 ? because I found this at
but, it is about win server 2003.
In the IIS manager, ASP limit,
max requesting entity body limit = 1073741824 // 1024 MB
Any help would be appreciated.
Jun 22, 2015 04:55 PM|bbcompent1|LINK
Try taking a look at this discussion thread, I think you are running into a default size limitation:
Configure the maxRequestEntityAllowed property in the asp limits sections of the web configuration:
If you have the Request Filtering feature installed and enabled, you should also set the "Maximum allows content length" value in IIS Manager -> Features -> Request Filtering -> Edit Feature settings
Jun 22, 2015 08:54 PM|usa2015usa|LINK
I think it should be large enought to download a 4MB file.
But, it still failed.
Jun 23, 2015 04:44 AM|Angie xu - MSFT|LINK
As mentioned above, you can try increasing maximum allowed size,
Jun 23, 2015 09:30 AM|usa2015usa|LINK
Can you please tell me how to open the "Edit request filtering settings" dialog window on win 7?
I cannot find it.
Jun 23, 2015 09:51 AM|usa2015usa|LINK
Can you please tell me how to open "edit requst filtering setting" window ?
I cannot find it on win 7.
Also, my IIS version is 7.5.
Jun 23, 2015 10:04 AM|usa2015usa|LINK
In IIS 7.5, the request filtering setting:
the max allowed content length is 30000000 bytes
it is 28 MB,
Why I cannot download a 4MB file ? Only 64KB is allowed.
Jun 29, 2015 04:33 PM|bbcompent1|LINK
Is this server hosted internally or is it outside your organization? According to Stack Overflow, there are two settings you can use in the web.config to change that:
This setting configures the upload file size limit:
Default size is ~30Mb.
Set your web.config with the following where xxx is the max upload size in kilobytes:
<httpRuntime maxRequestLength="xxx" />
The default is 4096 (= 4 MB). MSDN documentation
Now, it is entirely possible this setting may be laying in the default system configuration (machine.config), so check on this setting inside IIS GUI (http://frazsundal.blogspot.com/2011/02/request-filtering-module-is-configured.html):
As with all other IIS 7.5 configuration elements you can also edit directly in the GUI by going to "Configuration Editor" and editing system.webServer/security/requestFiltering. - See more at: http://frazsundal.blogspot.com/2011/02/request-filtering-module-is-configured.html#sthash.COq7payd.dpuf
Jul 07, 2015 05:37 PM|usa2015usa|LINK
Currently, in my IIS7.5 setting, maxAllowedContentLength=30000000
They should be large enough to allow downlaoding a 4MB file.
But, it does not work.
Jul 09, 2015 07:31 AM|bbcompent1|LINK
I would try reinstalling IIS if it were me since it sounds like the IIS Metabase is corrupted. If that does not work, I would suggest trying your set up on a different server. If it works there, then you may have no choice but to rebuild the server operating
system (providing this server is hosted internally).