posted 19 years ago
check the API docs (sigh...).
out is a PrintWriter, a PrintWriter works only with plain text.
What you need is a binary outputstream which you just happen to have available in the servletresponse.
Retrieve it using response.getOutputStream() after which you can . And use write(byte[]) and not the print() functions as those will assume you're writing text.