J
Jan Paul van de Berg
I have a piece of software that people can download and a third party
promoting that software. In order for them to be able to count the number
of downloads, I have to put a tracking code on my site. The tracking code
must be sent to the client when the user clicks the download button. At the
same time, the download must start. The download button links to this page:
- Possibility 1, server side redirect to executable
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<html>
<body>
<some iframe tracking code>
</body>
</html>
<%Response.Redirect("http://mysite.bla/myproggie.exe");%>
When I do this, the tracking code is not displayed because the redirect
happens earlier. The download does start though.
- Possibility 2: client side redirect to executable
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<script language="javascript">
function startDownload() {
location.href = "http://mysite.bla/myproggie.exe";
}
</script>
<html>
<body>
<some iframe tracking code>
<script language="javascript"> startDownload() </script>
</body>
</html>
When I do this, Windows XP SP2 users see a yellow message in the top of
their browser that the site is trying to execute a program. I don't want
that because it scares users away.
- Possibility 3: client side redirect to asp page that performs a server
side redirect
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<script language="javascript">
function startDownload() {
location.href = "http://mysite.bla/startdownload.asp";
}
</script>
<body>
<some iframe tracking code>
<script language="javascript"> startDownload() </script>
</body>
</html>
[startdownload.asp]
<%Response.Redirect("http://mysite.bla/myproggie.exe");%>
This also gives the warning in XP SP2. The strange thing is when I link the
download button directly to startdownload.asp, there's no warning.
How can I get this to work?
promoting that software. In order for them to be able to count the number
of downloads, I have to put a tracking code on my site. The tracking code
must be sent to the client when the user clicks the download button. At the
same time, the download must start. The download button links to this page:
- Possibility 1, server side redirect to executable
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<html>
<body>
<some iframe tracking code>
</body>
</html>
<%Response.Redirect("http://mysite.bla/myproggie.exe");%>
When I do this, the tracking code is not displayed because the redirect
happens earlier. The download does start though.
- Possibility 2: client side redirect to executable
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<script language="javascript">
function startDownload() {
location.href = "http://mysite.bla/myproggie.exe";
}
</script>
<html>
<body>
<some iframe tracking code>
<script language="javascript"> startDownload() </script>
</body>
</html>
When I do this, Windows XP SP2 users see a yellow message in the top of
their browser that the site is trying to execute a program. I don't want
that because it scares users away.
- Possibility 3: client side redirect to asp page that performs a server
side redirect
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<script language="javascript">
function startDownload() {
location.href = "http://mysite.bla/startdownload.asp";
}
</script>
<body>
<some iframe tracking code>
<script language="javascript"> startDownload() </script>
</body>
</html>
[startdownload.asp]
<%Response.Redirect("http://mysite.bla/myproggie.exe");%>
This also gives the warning in XP SP2. The strange thing is when I link the
download button directly to startdownload.asp, there's no warning.
How can I get this to work?