Files
i2p.i2p/apps/syndie/jsp/viewattachment.jsp
jrandom ef7d1ba964 2005-09-27 jrandom
* Properly suggest filenames for attachments in Syndie (thanks all!)
    * Fixed the Syndie authorization scheme for single user vs. multiuser
2005-09-27 22:42:49 +00:00

16 lines
732 B
Plaintext

<%@page autoFlush="false" import="net.i2p.syndie.web.*" %><%
request.setCharacterEncoding("UTF-8");
java.util.Map params = request.getParameterMap();
response.setContentType(ArchiveViewerBean.getAttachmentContentType(params));
boolean inline = ArchiveViewerBean.getAttachmentShouldShowInline(params);
String filename = ArchiveViewerBean.getAttachmentFilename(params);
if (inline)
response.setHeader("Content-Disposition", "inline; filename=" + filename);
else
response.setHeader("Content-Disposition", "attachment; filename=" + filename);
int len = ArchiveViewerBean.getAttachmentContentLength(params);
if (len >= 0)
response.setContentLength(len);
ArchiveViewerBean.renderAttachment(params, response.getOutputStream());
%>