• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

CANNOT download file from https in IE 6

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a thought. If you are using WinXP, perhaps a firewall is interfering?
 
Salman Moha
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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();
 
You are HERE! The other map is obviously wrong. Better confirm with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic