Powered By Blogger

Sunday, December 5, 2010

Response Headers

// set header based on filename - will force a Save As from the browse if it doesn't recognize it
// this is better than the default response of the browser trying to display the contents
res.setHeader("Content-Disposition", headerValue);


// set mimetype for the content and the character encoding + length for the stream
res.setContentType(mimetype);
res.setContentEncoding(reader.getEncoding());
res.setHeader("Content-Length", Long.toString(reader.getSize()));


Refer to the class

ContentGet webscript to see how the data will be sent to the front end

No comments:

Post a Comment