Search code examples
filemodel-view-controllerdownloadfilestream

MVC File Download asking for Authentication


I encountered a weird scenario. I have created an MVC2 Application and deployed it to IIS7, to 2 web sites (Default Web Site and another manually created "Test Web Site" ... they are using different application pools targeting v2.0). I am using SQL 2008 R2 Filestream feature to store files.

The problem I have is that I have a feature where the user browsing the site can download a document. The document is created in the server and the server then streams that to the client. The problem is, Default Web Site asks for authentication when user tries to download.

This doesn't happen for Test Web Site and it downloads fine.

Now, I do not have a clue what setting I need to change? The only different things I recall is that I manually created Test Web Site compared to just reusing the Default Web Site and also that I allowed inbound connections to Test Web Site (it was on port 8080).

What are the configurations needed to change so that user can download files from Default Web Site without going through authentication?


Solution

  • Turns out it was conflicting with the SQL Server Reports Manager.

    Found this out from here: source