• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Uploading and then displaying a file (specifically XML)?

JonTheBaller

Golden Member
Using JSP, I want to be able to upload a file via an HTML form and then display that file to the screen. I specifically want to be able to do this via XML, so a user could use a FileUpload form element to select an xml file, hit submit, and then view the XML file on the page (as a browser such as IE6 or Firefox would normally display an XML file). I have the uploading part working, and have the file stored in a File object. How do I display this object to the screen in the appropriate format (mime type application/xml?)? Thanks!
 
Well, are you storing the file in a web accessable location? They lazy and simple thing would be to just send a location header ie ( "location: filepath") to redirect them.
 
mime-type: text/xml

Don't know JSP at all, but if you can send headers you'd send the Content-Type header:

header('Content-Type: text/xml');
 
Back
Top