GeeCON Prague 2014*
The moose likes Struts and the fly likes Sending different types of data in HTTP response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Sending different types of data in HTTP response" Watch "Sending different types of data in HTTP response" New topic
Author

Sending different types of data in HTTP response

Prema Chakravarthy
Ranch Hand

Joined: Jul 13, 2004
Posts: 91
I am not sure if this is the right forum for this question, but it looked more appropriate than some others.

I am sending a file in a HTTPServletResponse to the client browser. So, I set the content type as follows:
response.setContentType("application/x-octet-stream");
response.setHeader("Content-disposition", "attachment; filename=" + file.getName() + ";");

I also have to send some other data that is not part of the file. Is it possible to do this?
John Smith
Ranch Hand

Joined: Sep 02, 2004
Posts: 61
I think you need to send your stuff seperately, you can have a dynamic link point to an url to grab your file and transport the other stuff in the normal way.
Prema Chakravarthy
Ranch Hand

Joined: Jul 13, 2004
Posts: 91
Thanks, John Smith
 
GeeCON Prague 2014
 
subject: Sending different types of data in HTTP response