What's new
Apple iPad Forum 🍎

Welcome to the Apple iPad Forum, your one stop source for all things iPad. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Hi I was trying to download a .csv file from my web application using Content-Disposi

sulokarthi

iPF Noob
Joined
Jan 19, 2012
Messages
1
Reaction score
0
Hi I was trying to download a .csv file from my web application using Content-Disposition
here is my code

response.setContentType("application/octet-stream");
}

filename = filename.concat(downloadType);
response.setHeader("Content-Disposition","attachment; filename="+filename+";");
//response.setHeader("Content-Disposition","application/octet-stream; filename="+filename+";");


String source = (String)ivHttpRequest.getAttribute("downloadFile");
if(downloadType.equals(".txt")) {
source = Utils.decodeHtmlEntities(source);
}
byte [] byteArray;

if(source == null)
{
// use ivRequest instead
String source2 = (String)ivRequest.getAttribute("downloadFile");
if(downloadType.equals(".txt")){
source2 = Utils.decodeHtmlEntities(source2);
}
byteArray = source2.getBytes();
}
else
{
byteArray = source.getBytes();
}
ServletOutputStream out = response.getOutputStream();
out.write(byteArray);
out.close();
I'm able to download the file in all the browsers, But while using IPAD the content of the file replaces the existing window (Parent Window) without asking for Save or Open
Please let me know is there any special content type or anythinmg else i have to chanage..
THe problem i faced only with IPAD
 

Most reactions

Latest posts

Back
Top