A similar problem occurred to me only for .pdf files. I changed the application pool identifier to Network Service and this fixed the problem.
I'm not sure why it worked, as the response header still had the same Content-Type , but it worked.
source share