We recently migrated a site from a freeBSD environment to a Windows environment. This morning accounting shared an error with me they were receiving when trying to access a system generated flat file. Typically, they select a few options and click a button, and are then presented with a page that contains a link to the generated flat file. Their process is to then right click the link and perform a "save target as" action. Now, however, right clicking the link and choosing 'save target as' produced a 404 error.
I first suspected that perhaps there was an issue with pathing since obviously 404 indicates a file not found. Going in the back door, though, there the file sat in all its glory, and with all the content it should have had.
Turns out that the real issue was the fact that IIS7 did not have a clue as to the mime type of the file generated. The previous developer had been quite fond of using the ".dat" extension when generating flat files, and, although the code was creating the file just fine, when attempting to navigate to it for a "save target as" action IIS7 didn't have a clue what to do with it. I would have thought IIS might have defaulted to a mime type of text, but instead it just pretended the file didn't exist.
The solution: add ".dat" to the list of mime types for that particular site, with a type of "text/plain".
You are not logged in, so your subscription status for this entry is unknown. You can login or register here.

