deal with spaces in filenames cleanly

This commit is contained in:
jrandom
2005-11-15 06:29:51 +00:00
committed by zzz
parent b031de5404
commit 024a5a1ad4

View File

@ -6,9 +6,9 @@ response.setContentType(ArchiveViewerBean.getAttachmentContentType(params));
boolean inline = ArchiveViewerBean.getAttachmentShouldShowInline(params);
String filename = ArchiveViewerBean.getAttachmentFilename(params);
if (inline)
response.setHeader("Content-Disposition", "inline; filename=" + filename);
response.setHeader("Content-Disposition", "inline; filename=\"" + filename + "\"");
else
response.setHeader("Content-Disposition", "attachment; filename=" + filename);
response.setHeader("Content-Disposition", "attachment; filename=\"" + filename + "\"");
int len = ArchiveViewerBean.getAttachmentContentLength(params);
if (len >= 0)
response.setContentLength(len);