File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Content-Disposition is replaces the parent window in IPAD

 
nishanth shanmugam
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As the iPad (not IPAD) has no user-accessible file system, what else would you expect it to do?
 
nishanth shanmugam
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:As the iPad (not IPAD) has no user-accessible file system, what else would you expect it to do?


Thanks For Correcting Me.. In iPad i'm just trying to download a .csv file for a button action. But the csv file just replaaces the parent window. How can i force it to display a save or open promt before downloading it... (Or please tell me whether we can do it or not) or atleast i need it to opened in a new browser window
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again, where would it download it to?
 
nishanth shanmugam
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Again, where would it download it to?

If downloading is not possinble means, just opening it in a new window is enough for me.
 
Rob Spoor
Sheriff
Pie
Posts: 20388
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the iPad even support more than 1 (browser) window at a time?
 
nishanth shanmugam
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:Does the iPad even support more than 1 (browser) window at a time?

New Tab is possible right?
 
Rob Spoor
Sheriff
Pie
Posts: 20388
46
Chrome Eclipse IDE Java Windows
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know, I don't own an iPhone, iPod or iPad (or any other device that starts with i). All I know is that some mobile devices (in which category I place iPads) have some limitations as far as multiple windows are concerned.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot "download" to an iPad and do anything else but display the file because there is no user-visible file system to write to.
 
nishanth shanmugam
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:You cannot "download" to an iPad and do anything else but display the file because there is no user-visible file system to write to.

ok.. but need to display it in a new tab (iPad can support new tabs right)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That has nothing to do with the iPad, but with the mobile browser being used. You can try sending the request to a new window or tab via target="_blank" on a link, but the browser will do what it will with that.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic