Hide Status Bar & Address Bar while file downloads

A

axelman

Hi everybody, sorry if this seems stupid but I'm a newbie :-( to all of
this.

I'm trying to hide the full file path in IE7 and IE6 while a user clicks on
alink on my page and downloads a file from my server, just want to open the
file download box but the path must remain invisible.

I've achieved this successfully in all other browsers (Fire fox, safari,
opera) with a simple call from mi HTML page to a JavaScript function that
only has a window.location(http://www.someaddress.com/myfile.zip), in an
external JavaScript file, like this:

<html>
<head>
<title></title>
<script type="text/JavaScript" src="somelink.js"></script>
</head>
<body>
<a href="javascript:downloadlink();" onmouseover="status='see you'; return
true;" onmouseout="status='later';">Download File</a>
</body>
</html>


How can achieve the same functionality in IE7 and IE6, please any help would
be greatly appreciated this is urgent.

Thanks in advanced
 
R

rob^_^

Hi Axelman,

I use Active Server Pages....


At the top of my page I have a hidden form

<form Style="visibility:hidden" name="frmDownload" Action="Download.asp"
method="POST" target="_top"><input id="txtID" type=hidden name="txtID"
value=""></form>

On my Download Button

<button Title="Download" style="cursor:hand; width:110; height:25;
float:right" onclick="DownloadPanel(446);" name="btnDownload"
value="Download">Download</button>

Note: I can have any number of Download buttons on my page, each with a
different DownloadPanel argument.

Here is the DownloadPanel function

function DownloadPanel(lID)
{
document.frmDownload.txtID.value = lID;
document.frmDownload.submit();
return true;
}


My Download.asp page takes the ID number of the download and looks up in a
database where to find that file on my server, increments a downloads
counter (so I can keep track of the number of downloads) and then Streams
the file back to the client.

All that the client sees is the Download prompt from IE or any other
browser.

If you don't know how to use Active Server Pages (asp, aspx, jsp, php), then
you will have to learn quick. You can find plenty of examples with a web
search.

Note: Your client browser needs Active Scripting enabled, so put a
<noscript> tag in your page eg.
<noscript><h1>You need active scripting enabled to use this web
site!!!</h1></noscript>

Again, if you need help you will find plenty of support on the web.

This is the Internet Explorer Public News Group, so you may like to try the
FrontPage or the Expression Web newsgroup next time.

Regards.
 
A

axelman

Hi rob^_^

Thank you so much for your help, I'll try your solution, one question the
download form is an empty form??

Thanks in advanced :)
 
R

rob^_^

Hi,

No, you just ad frmDownload to the page that has your download button on.
The is no intermediate form or dialog window. The user will just see the
Browser's download dialog with Open/Save on it and the name of the file in
the Title bar.

See http://www.iecustomizer.com homepage..... multiple download buttons on
the one page.... one hidden form and a background asp page does it all.

Regards.
 
A

axelman

Hi rob^_^

Can you please check my code and tell me what I'm doing wrong or what I'm
missing?, After I get the path of my file to download, how do I tie all
together??, this is very frustrating to me because I'm new to all of this.
My download.asp page below:

<html>
<head>
<title>Download Page</title>
<script type="text/javascript">
function DownloadDock(XID)
{
document.frmDownload.txtID.value = XID;
document.frmDownload.submit();
return true;
}
</script>
</head>
<body>

<form Style="visibility:hidden" name="frmDownload" Action="Download.asp"
method="POST" target="_top"><input id="txtID" type=hidden name="txtID"
value=""></form>

<button Title="This File" style="cursor:hand; width:110; height:25;
float:left" onclick="DownloadDock(446);" name="btnDownload"
value="Download">Download</button>

<%
Dim linkresult, strDB
strDB = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
Server.MapPath("/dbtest/files.mdb")

Set con = CreateObject("ADODB.Connection")
con.Open strDB
Set linkresult = con.Execute("select myfilepath from allmyfiles where
myfileID = '" & document.frmDownload.txtID.value & "'")

If NOT linkresult.EOF Then
Else
End If

Set linkresult = Nothing
con.Close
Set con = Nothing
%>

</body>
</html>

Is not my intention to bother you but I'm very embarrassed that I'm stuck.

Thank you in advanced
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top