I'm having really a weird problem with my website. It works fine locally, but online it shows iis 8 500 - internal server error.
In the both online and local versions of the site I use the same remote database. The website works online, but it drops when I try to upload a file to the "upload" directory, which is part of the website.
I don't know what the problem is because I can't get any detailed errors. I've added these code pieces in web.config, but still can'tget detailed error descriptions.
<httpErrors errorMode="Detailed" />
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.5"/>
<httpErrors errorMode="Detailed" />
I've also set the max file size:
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="4096" />
</requestFiltering>
</security>
and the size of the file I'm trying to upload is only few KBs. I suspect that the user doesn't have write permissions, and I asked the hosting admins to give write permissions (I'm waiting for that right now).
What do you think its the problem? Also, why am I not getting detailed errors?
Write permissions were the reason why I was getting the error.
I gave the folder read/write permissions before, but it looks like they were overridden when the newer project version was published.
(On publish we delete all files on the destination).
Related
I'm totally new in web development and I tried to create a simple rest api in vs2019/windows server 2016 for evaluation purpose.
My case/issue is as follows. I have a simple controller which has a 2 argument(string, string) method. If the whole request utf8 string is > 2101 characters the server returns a 404 in general.
I test this limitless time, with a dummy ("AAAAA.....") request string. 2002 length fails and 2001 length works. I tried to fix web.config but without luck, now I have a maxQueryStringLength exception.
Can anyone point me to the right direction?
In your site web.config, add the following configuration (modifying existing elements when they are present, otherwise adding new elements):
<system.webserver>
<security>
<requestFiltering>
<requestLimits maxUrl="65535" maxQueryString="65535"/>
</requestFiltering>
</security>
</system.webServer>
and
<system.web>
<httpRuntime maxRequestLength="65535" maxUrlLength="65535" maxQueryStringLength="65535" />
</system.web>
do not forget to restart the site or iis after doing changes.
I have a web application API which is published with IIS.
Clients upload files on my app (via PostMan) which I later process. It has been working fine. Now they tried to upload a large file of 70MB and they get 413 error.
I tried changing parts of web.config:
<system.webServer>
<serverRuntime uploadReadAheadSize="100000" />
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="30000000" />
</requestFiltering>
</security>
</system.webServer>
But I still get the same error. What am I missing?
I also had the same problem a while ago.
The fix is simply to up the size of the UploadReadAheadSize Metabase property.
IIS- uses a new Metabase property called UploadReadAheadSize when passing data to an ISAPI extension.
How To:
The following command instructs you to get the size as follows:
.cscript adsutil.vbs set w3svc/1/uploadreadaheadsize 204800
I have a bunch of web projects in Visual Studio that I moved from the C: drive to the D: drive.
I,
updated IIS to point to the new locations
done an IIS Reset
restarted the computer
cleared all the folders mentioned on this page
cleaned all my solutions
rebuilt all solutions and so forth.
And yet when I run any SpecFlow test I get a HTTP 500 error, with the root cause being that it can't find the web.config file of one of the solutions because it is looking for it on the C: drive rather than the D: drive.
What could I be missing?
i think Chrome is your web browser? This is the default error page Chrome displays when it receives a 500 HTTP response from the server with no content.
Run the site directly on the server – depending on the configuration of your site/server, you may be able to see the real error if you load the site from a browser located on the same server. You may need to turn off ‘show friendly http errors.’
Temporarily add the following within the appropriate tags in your web.config file:
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
</system.webServer>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" />
</system.web>
</configuration>
After you have added those, load the page again to see if you can get a more detailed error.
i save the file upload object in the session, and then use this session in the iframe, it works fine for VS web server for all file small or large
Issue :( => but on IIS it work fine for small size file, but gives error for larges files.
I THINK the reason is the file upload object dispose before completing the request so file steam in session not able to read the file.
can anyone tell me why it is not works for larges files and how can i get FileUpload object in other page
Try this in your web.config file..
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="524288000"/>
</requestFiltering>
</security>
</system.webServer>
maxAllowedContentLength is in BYTES.
Hope this helps you..
If you didn't specify this, default limit will be 30MB
I found the solution :) I put this line to web config file and it solve the problem:
<system.web>
<httpRuntime maxRequestLength="30480" requestLengthDiskThreshold="30480"/>
</system.web>
I have a simple webmethod
[WebMethod]
public int myWebMethod(string fileName, Byte[] fileContent)
However, whenever I pass a byte array which is larger than 30mb, I get the error:
HTTP Error 404.13 - Not Found
The request filtering module is configured to deny a request that exceeds the request content length.
My web.config is as follows:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"> </compilation>
<authentication mode="Windows" />
<httpRuntime useFullyQualifiedRedirectUrl="true"
maxRequestLength="102400" requestLengthDiskThreshold="102400"
/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="104857600"/>
</requestFiltering>
</security>
</system.webServer>
</configuration>
I've searched around, and the most common cause of this problem is the maxAllowedContentLength property being 30mb by default. However, I have set this to be 100mb, as well as the maxRequestLength property for httpRuntime.
I can't find a solution anywhere which isn't setting one of the properties I've already tried above. Is there something I have missed?
You problem may lie in the fact that settings made in the web.config file may be superseded by corresponding settings present in both the applicationhost.config and machine.config files.
If you have access to these, check if the overrideModeDefault property of the corresponding sections are set to Allow, as in the following example:
machine.config
<requestFiltering overrideModeDefault="Allow">
<requestLimits maxAllowedContentLength="104857600"/>
</requestFiltering>
AFAIK there is no way to override these settings if you don't have access to the corresponding configuration file.
You may find more information about system-wide configuration and settings override here, here and here - and a very similar case here.
This is pretty old. But I have the same problem today. To fix this, you need to make the necessary setting changes in web.config, then deploy to the web server. The important part is that you need to re-deploy your application to the web server. By doing so, the IIS settings are updated for you. Depending on how you do your deployment, you may need to delete your web application from the web server first, then deploy again. Updating web.config in place won't fix the problem. Hope this helps others with the same problem.