Fixing Incident: #18926 for all getSize()
This commit is contained in:
parent
f182f5e6ca
commit
10dd659d40
|
@ -237,7 +237,15 @@ public class DownloadServlet extends HttpServlet{
|
|||
|
||||
resp.setHeader("Content-Disposition", contentDisposition+"; filename=\"" + itemName + "\"" );
|
||||
resp.setContentType(mimeType);
|
||||
resp = setContentLength(resp, pdfFile.getSize());
|
||||
|
||||
//Fixing Incident: 18926, replacing pdfFile.getSize() with ItemStreamDescriptor.getSize()
|
||||
if(descr.getSize()!=null && descr.getSize()>0) {
|
||||
resp = setContentLength(resp, descr.getSize());
|
||||
}
|
||||
logger.info("The "+workspaceFileItem.getFileItemType()+" size is: "+descr.getSize());
|
||||
|
||||
//resp = setContentLength(resp, pdfFile.getSize());
|
||||
|
||||
InputStream is = descr.getStream();
|
||||
OutputStream out = resp.getOutputStream();
|
||||
IOUtils.copy(is, out);
|
||||
|
@ -263,7 +271,14 @@ public class DownloadServlet extends HttpServlet{
|
|||
String contentDisposition = viewContent?"inline":"attachment";
|
||||
resp.setHeader("Content-Disposition", contentDisposition+"; filename=\"" + itemName + "\"" );
|
||||
resp.setContentType(mimeType);
|
||||
resp = setContentLength(resp, imageFile.getSize());
|
||||
|
||||
//Fixing Incident: 18926, replacing imageFile.getSize() with ItemStreamDescriptor.getSize()
|
||||
if(descr.getSize()!=null && descr.getSize()>0) {
|
||||
resp = setContentLength(resp, descr.getSize());
|
||||
}
|
||||
logger.info("The "+workspaceFileItem.getFileItemType()+" size is: "+descr.getSize());
|
||||
|
||||
//resp = setContentLength(resp, imageFile.getSize());
|
||||
|
||||
InputStream is = descr.getStream();
|
||||
OutputStream out = resp.getOutputStream();
|
||||
|
|
Loading…
Reference in New Issue