How can I dump the contents of an image file on disk to the browser?
I tried this but the image is broken (broken image symbol in the browser).
<%@ include file="config.jsp" %>
<%@ page import="java.io.*" %>
<%@ page contentType="image/png" %>
<%
String fn = request.getParameter("f");
String filename = uploads_folder + fn;
File file = new File(filename);
FileInputStream in = new FileInputStream(filename);
int c;
while ((c = in.read()) != -1) {
out.write(c);
}
%>