Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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();
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic