Windows Azure ignoring files with unknown extensions - azure

I have uploaded my website to windows azure. The website is working properly on the local server.
I am uploading images to the server.
ISSUE:
If the files had some weird names like 2013_6_5_15_12_33_144pwzve.lg2
Windows azure shows 404 error
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
But works with this file name 2013_6_5_12_1_5_SampleStudent.png
I created some sample page to check if file is uploaded successfully it is.
All the files are on the server.
I checked using grid
grvNotSent.DataSource = Directory.GetFiles(Server.MapPath("~/Test"));
Any idea?
Any help is appreciated
Thanks

what is LG2? Have you added a mime type for that file extension in the web.config?
You can add the mime type mapping like this:
<system.webServer>
<staticContent>
<mimeMap fileExtension=".lg2" mimeType="whatever_this_type_is" />
</staticContent>
</system.webServer>
When IIS sees unknown mime type it ignores the request with 404.

Related

Why am I getting a 404 for my LESS file on my Azure App Service?

Ok, so... famous saying... this works locally, but not when I deploy.
I recently switched to using Less.js so that I could dynamically change my less variables with Javascript. Again, locally this works like a champ.
In my header I have it referenced:
<link rel="stylesheet/less" type="text/css" href="~/Content/main.less" />
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/3.9.0/less.min.js"></script>
When I use Visual Studio to deploy this to my Azure App Service I get a 404 on the less file and it all breaks.
I FTP'd into my server and the file is indeed there. https://i.imgur.com/cV5FQOW.png
I double checked to make sure that my properties for the less file are right. I have the build action set to Content and Copy if Newer. https://i.imgur.com/I3DbfHg.png
No matter what I do, if I go looking for that main.less file the azure server returns a 404.
As an FYI, the site is a ASP.Net MVC 5 website. I am using bundling, but only for external css like JQueryUI. I have removed the bundling of my CSS to work with the new stuff.
What am I missing?
Ok! After a bunch of attempts and searches I finally found a related error and found my solution.
This poor gentleman was having an issue serving up JSON files (angular2 app, http request for file json file, 404 on azure) and that made me think I had the same problem.
Eureka! I needed to update my web.config to let it serve LESS files.
<system.webServer>
<staticContent>
<mimeMap fileExtension=".less" mimeType="text/css" />
</staticContent>
<system.webServer>
Hope this helps someone else who runs into the same issue.

HTTP Error 500.19 - IIS and MIME Type not working in windows10?

I am trying to run my asp.net mvc website on the IIS. I got the following error:
HTTP Error 500.19 - Internal Server Error The requested page cannot be
accessed because the related configuration data for the page is
invalid.
I use IIS through IIS manager and when I try to configure MIME Types in IIS Manager, I got the following config error:
There was an error while performing this operation. Error: Cannot add
duplicate collection entry of type 'mimeMap' with unique key attribute
'fileExtension' set to '.woff2'.
As a result of my detailed research, this problem occurs on IIS 7.5. How to get rid of this errors and run my web page on IIS?
At first, try to install iis rewrite module to told IIS my custom web.config is not failure or faulty. If it's not fix the problem, I suggest another solution particularly for your problem. Delete your .wolf2 config from your web.config file. For example;
<staticContent>
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
</staticContent>
Delete mimeMap row which has .woff2 file extension from the staticContent. It would fix your problem because this error says that I already have .wolf2 in my config file but you trying to add one more.

web.config causes HTTP 500 issue with virtual directory in IIS

I'm fairly new to IIS so apologies if this is a basic question.
I have an IIS config serving an internal company website (php instead of asp.net). The prod version of the website is at the 'Default Web Site' level and I've got demo and test versions of the website mapped as virtual directories. The demo and test version are essentially copies of the prod directory. I've noticed the with the web.config copied to these VDs, I get an error 500 on the root url for the VD only. I.E. main website is https://mainwebsite.com and works fine but https://mainwebsite.com/demo/ doesn't work while https://mainwebsite.com/demo/index.php works fine.
The web.config file is pretty basic:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
</handlers>
<defaultDocument>
<files>
<add value="index.php" />
</files>
</defaultDocument>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="00:03:00" />
</staticContent>
</system.webServer>
</configuration>
Moving the web.config file out of the way in the VD resolves the issue. Even though the files are identical, I wouldn't think that the file should cause a conflict as my understanding is that IIS supports multiple web config files.
Although I have a workaround in place by renaming or deleting the file, I am wondering if there's a way to keep the file in place without it causing this error.
Thanks to Panama Jack in the comments, I was able to resolve my issue.
I got this response with detailed errors:
Error Summary
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
And further down:
Config Error
Cannot add duplicate collection entry of type 'add' with unique key attribute 'value' set to 'index.php'
To resolve, I simply commented out this line in the web.config XML:
<add value="index.php" />
I'm sure there's a better way to approach this but for now, this gets me my answer and also how to get more info from IIS when the logs are not useful.
if you create a virtual directory to another web root
web.config will cause this (personally I think the location of this file is totally insane.. mixed with htm and images etc. )
Replicate the directory somewhere else without the web.config file/excluding it..then point the virtual directory there.. & have a task set up to copy newer files over..

run processing.js on azure web sites

I made a projessing.js application. It works fine in localhost. However, when I deploy my project into my Azure website projessing.js is unable to find my sketch (.pde) file.This is the error message that I get from chrome's console ;
Uncaught Processing.js: Unable to load pjs sketch files: pde/Letter/Letter.pde ==> Invalid XHR status 404
I searched this problem and I found this post about it but I don't know how to make a configuration to my azure.This is the post that I found.I assume it is something related with permissions.
You will need to add the .pde MIME type to your IIS config (web.config file) in Azure. It will look something like the below XML block:
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".pde" mimeType="application/x-processing" />
</staticContent>
</system.webServer>
</configuration>
I'm not sure what the exact mime type is for that file, but the issue is that the MIME type isn't configured, and IIS will block unknown MIME types by default.

SharePoint error

I have a Sharepoint site and today when I try to login to the site it gives me the following error
Server Error in '/' Application.
Runtime Error Description:
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details:
To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
I've got to change this file:
You may also need edit the web.config in the layouts folder of the SharePoint root:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\web.config
And set
<customErrors mode="Off" />
Change the following in web.config and you will be able to see the detailed error.
<customErrors mode="Off"/>
and
CallStack="true"
Make sure you do this in all the WFEs. You will see detailed error. Once you have the detail error, post it here and we will be able to helop you more.
Set the custom error mode to remote only in your web.config file and try browsing the site again. This time you will get the detailed error with the stack trace. You can proceed from there.
Restart your server then try... Because in my case during I install visual studio on my server system, i can't access my site and i got same error what you posted in above, after restarted my server its works fine. that's why i am saying like that...
What i thought is, actually that time the IIS was disturbed by some other installation program.

Resources