views:

214

answers:

1

Hi,

I have a .ini file in the virtual directory of IIS. When i try to open the same in IE i get file not found HTTP 404 error.

http://www.virtualdirectoryname/sample.ini

Any inputs.

Please suggest some solution.

Thanks, Karthick

+1  A: 

By default, IIS will only serve files for which the extension matches a defined MIME type. See the following support article for reference - http://support.microsoft.com/kb/326965

To allow .ini files to be downloaded, follow the steps from the KB article linked above:

  1. Open the IIS Microsoft Management Console (MMC), right-click the local computer name, and then click Properties.
  2. Click MIME Types.
  3. Click New.
  4. In the Extension box, type the file name extension that you want (in this case, .ini).
  5. In the MIME Type box, type application/octet-stream.

Note: this is specific to IIS 6 or IIS 5.x - The process is slightly different for IIS 7.x

Saul Dolgin
Yes IIS 6.0, this is already done implemented, we have .ini in the MIME, also the same file opens in another virutal directoryFor ex:http://www.virtualdirectoryname1/sample.ini - Opens in IEhttp://www.virtualdirectoryname2/sample.ini - Doesn't openIn the webservice extensions(the .ini is allowed, the browse path refers to virtualdirectoryname1/sample.ini).I tried to add another .ini and referring to virtualdirectoryname2/sample.ini), but it didn't succeed.Any thoughts?
Karthick
If the MIME type is setup for .ini file extensions and it still returns 404, I have no idea. Double check your URL and make sure the path is correct (no typos, etc). Perhaps try renaming the file to "sample.htm" or "sample.txt" temporarily and see if you get something besides a 404. Good luck and let us know what the solution is by posting a response or as a separate answer!
Saul Dolgin
Yes the URL is correct, if i rename .ini to .txt, it opens but not for .ini, which is what am struggling , i need to make this to work as this .ini does updation.
Karthick
Sorry strange behavior, i restared the server and then it works. No clue what happened.
Karthick
That might make sense after all. The referenced KB article does mention that you should restart IIS after making the changes for it to take affect. At any rate, I'm glad that it's working now for you!
Saul Dolgin

related questions