my dog learned polymorphism*
The moose likes HTML, CSS and JavaScript and the fly likes File download error in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "File download error in javascript" Watch "File download error in javascript" New topic
Author

File download error in javascript

Vijay Chandran
Ranch Hand

Joined: Jan 07, 2007
Posts: 178
Dear Friends,

I am trying to write a file download app. The file to be downloaded is a plain text file. I'm using the following JavaScript function, which will hit the server and get the file content.

A new window is opened but when i'm getting an error response like this:
Internet explorer cannot download somefile from localhost.


I'm setting the following headers in the HTTP response at the server side:


My browser version is IE 8. This is working in latest version of chrome.

Please help in resolving the issue. Also, how to get Open/Save/Cancel dialog box when window.open is triggered and the response is obtained from the server?

Thanks,
Vijay
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File download error in javascript
 
Similar Threads
Outputting to .txt
response.setHeader("Refresh", "10; URL=http:\\ www.javaranch.com");
File Download Issue in IE
IE Address Bar issue
problem with download dialog box