Hi all,

I'm trying to use HttpClient to download an excel file from a web application.

Everything works but in my final excel document I get a series of meaningless integers printed out to the document.
Am I missing something obvious?


xml = method.getResponseBodyAsStream();

PrintWriter out = response.getWriter();

response.setHeader( "content-disposition","attachment; filename=projectList.xls" );
response.setContentType("application/vnd.ms-excel");

int excel;
while((excel=xml.read())!=-1){
    out.print(excel);
}

Thanks in advance,
Keith

Reply via email to