forked from I2P_Developers/i2p.i2p

* Properly suggest filenames for attachments in Syndie (thanks all!) * Fixed the Syndie authorization scheme for single user vs. multiuser
16 lines
732 B
Plaintext
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());
|
|
%> |