"Apache POI" kullanarak bir ".xlsx" dosyası (CustomerData.xlsx) oluşturdum.Apache TomCat Server'da dinamik olarak oluşturduğum bir dosyayı nasıl indirebilirim?
Sorun, dosyanın TomCat Sunucumda oluşturulduğu ve indirmem gerektiğidir.
HttpServletResponse response = null;
response.setContentType("xlsx");
response.setHeader(
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"attachment; filename=C:\CustomerData.xlsx");
try {
workbook.write(response.getOutputStream());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ama ne yazık ki, iş için görünmüyor:
Ben dosyayı indirmek için aşağıdaki kodu çalıştı.Herhangi bir fikriniz veya öneriniz olması durumunda, yayınlamaktan çekinmeyin.
yazma? http://stackoverflow.com/q/7822758 – BalusC