Reputation: 7525
I have a text file that I am trying to browse to using the browser http://files.mydomain.com/test.txt
and I get a:
HTTP Error 404.0 - Not found
I double checked and the text file does exist. When I add a test.htm
file, I have no issues.
Can someone help? Something tells me it's security issue.
Upvotes: 3
Views: 6880
Reputation: 572
I know this is an old post, but this might still help somebody out. I ran into this problem with my Asp.Net Core application. In my case it turned out that static files are served from a subdirectory called 'wwwroot' by default. Creating that subdirectory and moving the file in their solved it for me:
Upvotes: 1
Reputation: 37192
Kev has covered most of the possible problems, but for reference there is another possibility.
Confirm that in Request Filtering
you either
.txt
as an Allowed extension, orAllow unlisted file name extensions
ticked in Edit Request Filtering SettingsThe same effect can be achieved with the following web.config section:
<system.webServer>
<security>
<requestFiltering>
<fileExtensions>
<add fileExtension=".txt" allowed="true" />
</fileExtensions>
</requestFiltering>
</security>
</system.webServer>
Upvotes: 2
Reputation: 12860
Add the MIME-Typ by going to ...
et voila
Upvotes: 0
Reputation: 13106
Also make sure also that the website is started. I was getting 404 and then realized that the Default Website was stopped because another website (Sharepoint) was using port 80. Sometimes the obvious is what gets you.
Upvotes: 1
Reputation: 119806
Have you checked the following:
.txt
extension?.htm
extension to say the ASP ISAPI filter and accidentally removed the StaticFile handler?.jpg
, .gif
, .pdf
etc?Upvotes: 3