Connecting Tech Pros Worldwide Help | Site Map

Issue with using iFrame for download in IE6

  #1  
Old September 5th, 2008, 02:36 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 221
I'm having an issue in IE6 (not an issue in IE7 or Firefox) where the file save dialog window isn't appearing. I'm using a hidden iframe to prompt for a download when a user clicks a link. Any help would be appreciated.

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function download_req_doc(req_doc){
  3.     var answer = confirm("Would you like to download the required documents?")
  4.     if(answer){
  5.         valid_req_doc = document.getElementById(req_doc).value
  6.         oIfrm=document.getElementById('myIFrm')
  7.         oIfrm.src=valid_req_doc
  8.         alert("To complete the evaluation process please submit the completed document to Human Resources.")
  9.         alert("REMEMBER: YOU MUST SAVE THIS FILE TO YOUR COMPUTER!")
  10.     }
  11. }
  12. </script>
  13.  
  14. ...
  15.  
  16.             <cfif session.access eq 'manager' or session.access eq 'admin'>
  17.                 <li><a href="##" onclick="download_req_doc('valid_req_path');">Download Required Documents</a></li>
  18.             </cfif>
  19.  
  20. ...
  21.  
  22. <iframe id="myIFrm" src="" style="display:none"></iframe>
  23.  
  #2  
Old September 5th, 2008, 03:33 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,526
Provided Answers: 12

re: Issue with using iFrame for download in IE6


I don't know if this will solve the problem, but try giving it a name and access using window.frame["frameName"].
  #3  
Old September 5th, 2008, 05:20 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 221

re: Issue with using iFrame for download in IE6


Quote:
Originally Posted by acoder
I don't know if this will solve the problem, but try giving it a name and access using window.frame["frameName"].
I tried to name my iframe to myIFrm and changed my javascript to this:

window.frame["myIFrm"].src=valid_req_doc

but that gave me a javascript error
  #4  
Old September 5th, 2008, 05:25 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,526
Provided Answers: 12

re: Issue with using iFrame for download in IE6


Sorry, that should've been window.frames[].
  #5  
Old September 5th, 2008, 05:44 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 221

re: Issue with using iFrame for download in IE6


Quote:
Originally Posted by acoder
Sorry, that should've been window.frames[].
O yeah, I should have known that. I tried it again, no error but the dialog window won't appear. Stupid IE 6, errrr
  #6  
Old September 5th, 2008, 06:02 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,526
Provided Answers: 12

re: Issue with using iFrame for download in IE6


OK, instead of hiding it, try making it 0 size:
Expand|Select|Wrap|Line Numbers
  1. <iframe ... style="width:0px; height:0px; border: 0px">
  #7  
Old September 11th, 2008, 05:10 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 221

re: Issue with using iFrame for download in IE6


Quote:
Originally Posted by acoder
OK, instead of hiding it, try making it 0 size:
Expand|Select|Wrap|Line Numbers
  1. <iframe ... style="width:0px; height:0px; border: 0px">
Hey acoder, sorry it took me a while to respond, I was on vacation. I tried setting the height/width but it didn't work either, hmmmm.
  #8  
Old September 12th, 2008, 12:43 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,526
Provided Answers: 12

re: Issue with using iFrame for download in IE6


With window.frames[] syntax, use location.href. See this link.
  #9  
Old September 15th, 2008, 04:26 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 221

re: Issue with using iFrame for download in IE6


Quote:
Originally Posted by acoder
With window.frames[] syntax, use location.href. See this link.
Tried a few of those methods from that page, but still nothing. I'll just tell them to download off the network for those users using IE 6.
  #10  
Old September 15th, 2008, 06:33 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,526
Provided Answers: 12

re: Issue with using iFrame for download in IE6


...or encourage them to upgrade. Sorry I couldn't help further.
  #11  
Old September 16th, 2008, 01:13 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 221

re: Issue with using iFrame for download in IE6


Quote:
Originally Posted by acoder
...or encourage them to upgrade. Sorry I couldn't help further.
You are a huge help acoder, I appreciate your help very much!!
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox - replacing the whole page by the new one in Ajax response evgenyg@gmail.com answers 4 September 24th, 2006 04:35 PM
FRAMESET IntraRELY answers 10 November 17th, 2005 08:23 PM