473,405 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Use iframe to initiate file download

jef
I have a page (I call FileDownload" that intitiates a download of the
filename passed to it. I called it from another page via javascript:
window.open("FileDownload?file=blahblh");

it works fine but opens a blank browser window when it pops up the
download dialog (my target browser is IE).... someone suggested I use
an Iframe on the calling page so the blank browser window doesn't
appear. So i created a hidden frame on the page, but can't figure out
how to make it work..
I've tried both:

Iframe.src="FileDownload?file=blhablahb";
and
Iframe.location.href="FileDownload?file=blahb";

neither work...

I've tried to load other pages and that doesn't work eiither... so I
dont' think it has anything to do with the FileDownload page.

any help is appreciated.

Jul 23 '05 #1
4 10735
jef wrote:
I have a page (I call FileDownload" that intitiates a download of the
filename passed to it. I called it from another page via javascript:
window.open("FileDownload?file=blahblh");

it works fine but opens a blank browser window when it pops up the
download dialog (my target browser is IE).... someone suggested I use an Iframe on the calling page so the blank browser window doesn't
appear. So i created a hidden frame on the page, but can't figure out how to make it work..
I've tried both:

Iframe.src="FileDownload?file=blhablahb";
and
Iframe.location.href="FileDownload?file=blahb";

neither work...

I've tried to load other pages and that doesn't work eiither... so I
dont' think it has anything to do with the FileDownload page.

any help is appreciated.


window.open("FileDownload?file=blahblh", "dummyfrm");
.......
<iframe name="dummyfrm"></iframe>

Jul 23 '05 #2
jef
Thanks for the reply.. but that didn't work..

.... I'm sure people do this all the time... I just need to know how to
set the URL of the conents of the IFRAME via javascript...

anyone?

Jul 23 '05 #3
jef wrote:
Thanks for the reply.. but that didn't work..

... I'm sure people do this all the time... I just need to know how to set the URL of the conents of the IFRAME via javascript...

anyone?


Hi jef.

'that didn't work' isn't going to help much. Calling window.open(*url*,
*frame_name*) ~is~ one of the things people 'do..all the time' to set a
frame's url. Could we see what you're doing, exactly?

This is what I mean:

<quote>
Iframe.src="FileDownload?file=*blhablahb";
</quote>

What does 'Iframe' mean in that statement? Nobody reading that would
have any idea - and that might be the problem. Please be specific.

Jul 23 '05 #4
"jef" <je************@gmail.com> wrote in news:1113489445.889662.75460
@g14g2000cwa.googlegroups.com:
Thanks for the reply.. but that didn't work..

... I'm sure people do this all the time... I just need to know how to
set the URL of the conents of the IFRAME via javascript...

anyone?


document.getElementById('someID').src='FileDownloa d?file=blhablahb';

<iframe id="someID" ... >
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: boyscout | last post by:
On a page I'm offering file download links which are each targeted to an tiny 1-pixel X 1-pixel iframe on the same page. (If you care why, see below.) Under certain conditions, I want to popup a...
4
by: Laphan | last post by:
Hi The god that is Martin Honnen gave me a great tip to DOM/JS some HTML data into an iframe, but I need to make sure that the iframe is ready to take it before I paste it in. At the moment,...
2
by: jwf | last post by:
I am developming a web application in ASP.NET (VB) and am looking to develop functionality where a user clicks on a link to download a file but at no point can the user see the actual URL link to...
2
riptide2049
by: riptide2049 | last post by:
I really have a problem here. I have a code that is suppost to take the href of a link from the right class;value of a link maked toreturn false. the value is a Media file the file is sent to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.