Link to home
Start Free TrialLog in
Avatar of aztec
aztec

asked on

execute some HTML *only* after a download completes

Hi...
  Is there a way to have some HTML code executed ONLY after a downloaded file is *complete*? Is there some way to detect for this?
   Even to have a little "pop-up" window come up after the the download is complete, that would be fine too.

Thanks
   Shawn
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

The answer is yes, sort of. HTML does not actually execute it just applies markup.  You can use JavaScript to do something dynamic using and onLoad event on the body tag.  If you could give us some detail of what you want to do, we can probably help.

Cd&
Avatar of aztec
aztec

ASKER

ok, I have one of these "Ad Tracker" things (www.hypertracker.com) and basically what I want to do is execute the following 'invisible' HTML code everytime a download of my demo is totally *completed* (not just invoked... completed):

<IMG SRC="http://hyperTracker.com/count.php?user=mycompany&name=my+demo+download&sales=0&description=&value=0.00&protection=default" BORDER="0" HEIGHT="1" WIDTH="1" ALT="">

This HTML code is invisible to the end-user (does not show a graphic or anything) - it simply tallies 1 to the count of downloads.

Currently, on my main page I have a link to the download page... and in the download page I have this HTML code to invoke an automatic download immediately:

<body onLoad='location="http://www.listmate.com/ddlmp/";' bgcolor="#FFFFFF">

...so I'm thinking if there was a way - when the download is complete - to pop up a little window which simply says "Thank you for downloading the demo...", and in that window is contained my invisible tracking HTML I mention above.

What do you think?

Thanks
   Shawn

 
I don't know what event you could use to trigger it.  There is nothing to indicate when a download is complete.  I think you have to handle the sount server side.

Cd&
Basically you woant to count how many times a particular file has been downloaded. right?

for that as cd& said you need to do it server side. if you can use cgi's then the following site would interest you and they have free scripts for what you want.
http://cgi.resourceindex.com/
Avatar of aztec

ASKER

lexxwern - I just don't want to count when someone clicks on my file to download, I want to only count when the download has been completed.
   Do you know if any of those do that?

Thanks
   Shawn
Avatar of aztec

ASKER

hello?
"and in that window is contained my invisible tracking
HTML I mention above."

lexxwern was refering to your tracking. You cant do this client side, only server side ...

Or ... put a counter in your popup. (just an idea)

dech
Avatar of aztec

ASKER

Do you know what is required "server side" to do this? I asked my web host, but he doesn't know how to do it. If this is not the correct topic for this question, please refer me to the properone.

Thanks
   Shawn

does your host allow scripting? if yes which scripting languages?
Avatar of aztec

ASKER

he can handle CGI and Perl
Even server scripting is not going to dependabley tell when a download has completed successfully.  

You may be able to script something to tell you when the last packet gets sent.  You can detect if tcp/ip completes the transfer.  However you cannot know from the srver side if the browser is even still running, or if the download successfully was transferd to disc or if the user is still on the site.

To know it succeeded.  The browser must come back to the server and say so.  It cannot do that automatically.  There does not seem to be a satifactory means of detecting it so a function can be triggered.  

That leaves one option.  Ask the user to ackowledge receiving the download successfully.

Yes maybe one additional option...  Continue wasting your time on it until the technology changes sometime in the future.

Cd&
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I will recommend DELETE where there is any
   question about its value as a PAQ.  Silence = you don't care
</note>

<greed> my points?</greed>

Cd&
Avatar of aztec

ASKER

you can delete it CD - I guess no such solution exists.

Shawn
RECOMMENDATION_________________



Zero Point PAQ



______________________________END
ASKER CERTIFIED SOLUTION
Avatar of Moondancer
Moondancer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial