473,769 Members | 3,923 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automatic download start

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="JA VASCRIPT" CODEPAGE="1252" %>
<html>
<body>
<some iframe tracking code>
</body>
</html>
<%Response.Redi rect("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="JA VASCRIPT" CODEPAGE="1252" %>
<script language="javas cript">
function startDownload() {
location.href = "http://mysite.bla/myproggie.exe";
}
</script>
<html>
<body>
<some iframe tracking code>
<script language="javas cript"> 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="JA VASCRIPT" CODEPAGE="1252" %>
<script language="javas cript">
function startDownload() {
location.href = "http://mysite.bla/startdownload.a sp";
}
</script>
<body>
<some iframe tracking code>
<script language="javas cript"> startDownload() </script>
</body>
</html>

[startdownload.a sp]
<%Response.Redi rect("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.a sp, there's no warning.

How can I get this to work?
Jun 23 '06 #1
2 2564
you should move the tracking code logic to the server. have an aspx page do
the download:

mydownloadpage. aspx?id=<downlo ad file id>&src=<third party site id>

use Response.WriteF ile and response headers to do the download. google for
more info.

-- bruce (sqlwork.com)

"Jan Paul van de Berg" <ja**@ulvandebe .rg> wrote in message
news:n4******** *************** ******@40tude.n et...
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="JA VASCRIPT" CODEPAGE="1252" %>
<html>
<body>
<some iframe tracking code>
</body>
</html>
<%Response.Redi rect("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="JA VASCRIPT" CODEPAGE="1252" %>
<script language="javas cript">
function startDownload() {
location.href = "http://mysite.bla/myproggie.exe";
}
</script>
<html>
<body>
<some iframe tracking code>
<script language="javas cript"> 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="JA VASCRIPT" CODEPAGE="1252" %>
<script language="javas cript">
function startDownload() {
location.href = "http://mysite.bla/startdownload.a sp";
}
</script>
<body>
<some iframe tracking code>
<script language="javas cript"> startDownload() </script>
</body>
</html>

[startdownload.a sp]
<%Response.Redi rect("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.a sp, there's no warning.

How can I get this to work?

Jun 23 '06 #2
Thanks for the info. Unfortunately all examples I find assume you don't
have a 3rd party script but just want to force the download start. I've
tried this [1]:

<%@ Import Namespace="Syst em.IO"%>
<script language="VB" runat="server">
Sub Page_Load(sende r As Object, e As EventArgs)

Dim filepath As String = Server.MapPath( "myproggie.exe" )
If File.Exists(fil epath) Then
Dim filename As String = Path.GetFileNam e(filepath)
Response.Clear( )
Response.Conten tType = "applicatio n/octet-stream"
Response.AddHea der("Content-Disposition", _
"attachment ; filename=""" & filename & """")
Response.Flush( )
Response.WriteF ile(filepath)
End If

End Sub
</script>

No matter what I try, I can't get mydownloadpage. aspx to send html to the
browser. Not by adding Response.Write( <3rd party script>) anywhere, not by
adding HTML. It behaves like Possibility 1 I described.

[1] a modified version of
http://www.ondotnet.com/pub/a/dotnet...04/01/asp.html, all other
references to this method I can find work the same

Op Fri, 23 Jun 2006 08:56:09 -0700 schreef bruce barker (sqlwork.com):
you should move the tracking code logic to the server. have an aspx page do
the download:

mydownloadpage. aspx?id=<downlo ad file id>&src=<third party site id>

use Response.WriteF ile and response headers to do the download. google for
more info.

-- bruce (sqlwork.com)

"Jan Paul van de Berg" <ja**@ulvandebe .rg> wrote in message
news:n4******** *************** ******@40tude.n et...
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="JA VASCRIPT" CODEPAGE="1252" %>
<html>
<body>
<some iframe tracking code>
</body>
</html>
<%Response.Redi rect("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="JA VASCRIPT" CODEPAGE="1252" %>
<script language="javas cript">
function startDownload() {
location.href = "http://mysite.bla/myproggie.exe";
}
</script>
<html>
<body>
<some iframe tracking code>
<script language="javas cript"> 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="JA VASCRIPT" CODEPAGE="1252" %>
<script language="javas cript">
function startDownload() {
location.href = "http://mysite.bla/startdownload.a sp";
}
</script>
<body>
<some iframe tracking code>
<script language="javas cript"> startDownload() </script>
</body>
</html>

[startdownload.a sp]
<%Response.Redi rect("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.a sp, there's no warning.

How can I get this to work?

Jun 26 '06 #3

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

Similar topics

7
3001
by: William Ryan | last post by:
Are you using an intranet or the internet to push the updates? If the internet, you probably can't get there without a web server. If you are using an intranet, you can do it from a shared folder. Paul Kimmel has a new book http://www.amazon.com/exec/obidos/ASIN/0672324075/internco m-20/002-4611773-6304806 that discusses this in depth... I can send you some code to do it. Effectively you need two assemblies, one that calls the...
0
2582
by: jmd | last post by:
Hello. I want to write a C# program that does completely automatically what, until now, I do manually, witch is describe below : 1. I launch IE (6) 2. I browse to my desired download page, say http://www.site.com/download This download page contains some textboxes, checkboxes, radiobuttons, a DOWNLOAD BUTTON and text 3. I check some checkboxes, select some radiobuttons, enter text in some textboxes and click on the download button
2
1875
by: Trygve Lorentzen | last post by:
Hi, I'm developing an app with automatic version checking and updating. It must also track what version is installed for each customer in our customer database. I have made a small client to fetch updated file(s) from the net and copy over the old files. I figured this must be done since the program itself will be read/write locked as long as it is running. I have a progressbar prgDownload that shows the download progress. My main...
1
1768
by: Iulian | last post by:
Hi, I am working on a directory type of site and I got stuck in the following problem: when the user clicks on the download link I present a page that sais: "Contacting download site... If the download does not start in 10 sec. please click the link below". At this point I would like to attempt to download the file and send it to the client. One think I managed to do is to call a "DownloadBridge.aspx" page from the Body's onload event and...
18
16407
by: jmd | last post by:
Hello, I posted the following in the C# forum but without one answer. But perhaps now in vb.net someone has some guidelines ! This is my question : I want to write a vb.net program that does completely automatically what, until now, I do manually, witch is describe below : 1. I launch IE (6)
1
2719
by: rdemyan via AccessMonster.com | last post by:
My App has 10 or so tables that we provide that contains proprietary data. This data will need to be updated once or twice a year. I would like some comments, suggestions on my proposed strategy for updating these tables via an ftp site: 1) Post a .mdb file to our ftp web site that contains the updated tables. My App code connects to the ftp site and gets the file name for any update files on the site. I already have code to do this...
0
2145
by: ar | last post by:
Hello, In IE I disable "Automatic prompting for file downloads" which causes the IE information bar to show up when I try to push a file download from an iframe. I want to keep this behaviour. When clicking "Download file..." on the information bar, a postback occurs. I would like to detect this postback. The file that is going to be downloaded is generated by a rather heavy export, now the export is running twice. Once before the...
6
2027
by: Mike Saunders | last post by:
I have a basic web site where people can download my programs. To make it easier for them is it possible that I could add some javascript that would allow them to automatically install/run the program for them maybe with appropriate options/warnings etc Sme example code would be most appreciated Many thanks
25
2671
by: sidd | last post by:
In the following code: int i = 5; ---it goes to .data segment int j; ---it goes to bss segment int main() { int c; int i = 5; ---stack
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10049
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.