0

I am using IIS server to host my .net (MVC) application and we have 2 different RDPs for our two environment 1) Development and 2) Production.

Code for checking Content-type :

if (file.ContentType != "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
        {
            data.Status.Message = "Please upload a valid excel file of version 2007 and above";
            return data;
        }

In Development environment we are getting "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet and in Production we are getting it blank "

Is there anyone faced such kind of situation? how to solve this?

The issue is i cannot give a fresh build to resolve the issue, all i can do is to try resolving this issue without touching the Compiled DLLs.

Thanks for any help.

  • Is this server or client code? What is `file`? In any case, the content type is set by the *client* that uploads the file or the *server* that sends it. If the other side didn't set it at all, you won't get a value – Panagiotis Kanavos Aug 03 '18 at 15:27
  • Its an object of HttpPostedFileBase. and a server code .But how its possible that other environment runs perfectly with the same code?might there be a problem with my browser or IIS configuration? @PanagiotisKanavos – krunal patel Aug 03 '18 at 15:32

0 Answers0