Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save Dialog for zip file - Urgent Help!

Status
Not open for further replies.

mskvimal

Technical User
Oct 9, 2007
3
US
I have a ZIP file in the server. I want create a create a save dialog to save the zip file in local machine.


The below code works perfectly fine for firefox but not on IE. apparently I want the code to work in IE. I posted this question in couple of JS forum. I did not get any feed back......any help is greatly appreciated.

<html>
<head></head>
<script language='javascript'>
function JBTRunZip( ){

location.href="IMAN_IMAGE_FILES.zip";

}
function download(locate){
window.open(locate)
}
</script>
<body>
<button onclick="JBTRunZip()">generateZip</Button>
<td><input type ="Button" value ="Scarica" onclick="download('Test.zip');"></td>
</body>
</html>
 
Code wise it looks OK with the exception of a possible missing DOCTYPE. Did you declare a DOCTYPE in the original code? IE requires this or you will have issues with JS.

Additionally, IE9, is a PITA, (pain in the a**,) at times. I have some issues with it as well.



The shortest distance between two points is NOT a straight line; it's a worm hole!
 
No I did not declare DOCTYPE . can you tell me what exactly I should add.

I would appreciate if you can send me snippet
 
It all depends on what standard you are wanting to meet. Here are a few common examples.

XHTML 1.0 Transitional:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
HTML 4.01 Transitional:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
HTML5:

<!DOCTYPE html>

It is place first in the code. Example:

<!DOCTYPE xxx>
<head>
<title><title>
</head>
<body>
</body>
</html or xhtml> //close tag



The shortest distance between two points is NOT a straight line; it's a worm hole!
 
Thanks Larry. I wasn't aware of that link myself so I book marked it!

I have used the validation site: but was unaware of the site you recommended.

The shortest distance between two points is NOT a straight line; it's through a worm hole!
 
Even adding the DOCTYPE did not resolve my issue. so as a temporary solution.

1. I create a php and deployed in the Apache.
2. I open the php url < full path to zip file> in a new window.

3. The php will force the browser to pop the save dialog to the user.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top