core-jgi/org.adempiere.ui.zk/gif.jsp

22 lines
680 B
Plaintext
Raw Normal View History

2012-12-21 17:48:41 +07:00
<%@ page language="java" contentType="image/gif"%>
<%
String fileName = request.getParameter("f");
if (fileName != null && fileName.endsWith(".gif")) {
java.io.File f = new java.io.File(fileName);
if (f.exists() && f.canRead()) {
response.setContentLength(new Long(f.length()).intValue());
java.io.FileInputStream fis = new java.io.FileInputStream(f);
java.io.BufferedInputStream bis = new java.io.BufferedInputStream(fis);
java.io.OutputStream os = response.getOutputStream();
java.io.BufferedOutputStream bos = new java.io.BufferedOutputStream(os);
while (bis.available() > 0)
{
bos.write(bis.read());
}
bis.close();
bos.flush();
bos.close();
}
}
%>