Jump to content

Content type from file


pcurran

Recommended Posts

For the purpose of debugging, I have created XML files, which I load using XMLHttpRequest functions. All works well in Firefox, but not in IE. In IE, the "responseText" field of the response contains the data, but the "responseXML" field does not. Evidently, the content is not being recognized as XML.Ultimately, the content-type header will be set correctly when this comes from the real server, but that is not a practical way for me to develop the code. Can I specify the content type in some other way, since I am not using HTTP? (The file extension is .xml, and the file starts with <?xml version="1.0"?>, but IE doesn't recognize it as XML.Thanks for any help.

Link to comment
Share on other sites

Ultimately, the content-type header will be set correctly when this comes from the real server, but that is not a practical way for me to develop the code. Can I specify the content type in some other way, since I am not using HTTP? (The file extension is .xml, and the file starts with <?xml version="1.0"?>, but IE doesn't recognize it as XML.
Why is this impractical? Cost? Time? If all you need is a true HTTP response, Download Apache HTTP server and install it for free.Assuming you do a default install of the latest version, put your files in the "htdocs" folder of the install directory (C:\Program Files\Apache Software Foundation\Apache2.2\htdocs), start the server, and make your request to http://localhost:8080/yourfile.xml.If I've understood your problem right, I think that will work for you.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...