Hi every one,

In order not to store my download data in memory, I'm saving the data into a 
temp file.  To download the data I stream the data directly from file:

public void appendToResponse(WOResponse response, WOContext context) {
        
response.setHeader("application/octet-stream", "Content-Type");
response.setHeader("attachment; filename=" + fileName, "Content-Disposition");
        
        
try {
        long dataLength = inputFile.length();
        FileInputStream inputStream = new FileInputStream(inputFile);
        response.setContentStream(inputStream, 0, dataLength);
} catch (IOException e) {
        log.error("failed to get size: " + e.getMessage(), e);
}

}


This works as expected, but not when the app is deployed as a servlet container.

Has anybody a hint, why Content-Length=0  and only 0 bites are read  in servlet 
container deployment?




Regards,

René Bock
Software Engineering

--
salient doremus
http://www.salient.de                           http://www.openforms.de

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to