File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CANNOT download file from https in IE 6

 
Salman Moha
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a similar problem. When I am trying to save/open a file from server(secure) which uses HTTPS, its displaying error message:

Internet Explorer cannot download ...File_name.doc from Server_name.
Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.

My code is below. Please help me out.
Its working with my localhost(http) and with Firefix browser. Its something to do with http and IE 6.


<java>
if (!request.getScheme().equals("https"))
response.setHeader("Pragma", "no-cache");

String fileName=request.getParameter("instruction");
//filename = filename.replaceAll( "\\W*", "" ) ;
String DirName = request.getParameter("directory");
String value = (DirName+"/"+fileName);

File f = new File (value);
response.setContentType("application/msword");
//set the header and also the Name by which user will be prompted to save
response.setHeader("Content-disposition", "attachment; filename=" + fileName);

InputStream in = new FileInputStream(f);
out.clearBuffer();

int bit = 256;
int i = 0;

try {

while ((bit) >= 0) {
bit = in.read();

out.write(bit);
}

} catch (IOException ioe) {
ioe.printStackTrace(System.out);
}

out.flush();
out.close();
in.close();
</java>
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a thought. If you are using WinXP, perhaps a firewall is interfering?
 
Salman Moha
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there.

Its working well with the firefox browser. I checked out without XP firewall.

When I click the link to open/ download a word file, its showing the (File Download warning) content disposition window but when I click save or open,,, I get error message "Internet Explorer cannot download ...File_name.doc from Server_name.
Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later. "

In the content disposition window ( file download warning window), "File Name" is the filename path, and "From" is the server name/path. but nothing is displayed in "File Type"! Hope this might have something to do. Please help me out.


My code is as follows
if (!request.getScheme().equals("https"))
response.setHeader("Pragma", "no-cache");

String fileName=request.getParameter("instruction");
//filename = filename.replaceAll( "\\W*", "" ) ;
String DirName = request.getParameter("directory");
String value = (DirName+"/"+fileName);

File f = new File (value);
response.setContentType("application/msword");
//set the header and also the Name by which user will be prompted to save
response.setHeader("Content-disposition", "attachment; filename=" + fileName);
response.setHeader("Cache-Control", "cache");
response.setHeader("Cache-Control", "must-revalidate");
InputStream in = new FileInputStream(f);
out.clearBuffer();

int bit = 256;
int i = 0;

try {

while ((bit) >= 0) {
bit = in.read();

out.write(bit);
}

} catch (IOException ioe) {
ioe.printStackTrace(System.out);
}

out.flush();
out.close();
in.close();
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic