loading .json files generates 404 errors

后端 未结 4 751
悲哀的现实
悲哀的现实 2020-12-14 06:13

My first Azure website is a simple test site I\'ve had for a while that makes ajax calls back to the server for JSON data. All the data files have .json extensions. Azure

4条回答
  •  难免孤独
    2020-12-14 06:32

    Citing Ahmed Sabbour with his blog post http://blogs.msdn.com/b/africaapps/archive/2013/06/07/how-to-serve-static-json-files-from-a-windows-azure-website.aspx you have to do the following:

    "If you upload a .json file to your Windows Azure website and try to access it, it would give you a 404 File Not Found error, because the MIME Type of .json is not set by default. This also applies in general to any file that might need a specific MIME Type.

    To fix this issue, FTP into your website and upload the following Web.config file which will set the correct MIME types. If you already have a Web.config file in place, just add the below to the appropriate section.

    
    
    
        
            
                
         
        
     
    

    ". I did this and the 404 was gone.

提交回复
热议问题