Have you ever been to a website that offers downloads of stuff? And while you are waiting for the download, there are lots of ads around? Sure you have. I have too.
The last day I was downloading stuff. An idea came to my head. Was there a site which required to stay and watch the ads while you are downloading? Didn’t see one. Is that technically possible? Sure. I wanted to show how. So I made a small web app for that.
How does this app work?
- The user visits the download page.
- He gets through the bushes of ads and clicks on “Download”.
In the background, PHP script creates a “download is active” file with the
current modification time.
- The download is made through a PHP script. The script checks if the “download
is active” file has modification time of allowed age. If the file gets older
than allowed, the download is canceled server-side.
- While on this page, after clicking “Download”, there is a invisible counter
started which calls a “download still active” URL that updates the modification
time of the “download is active” file. Thus, if the user doesn’t leave the page,
the download is not canceled.
Do I recommend this or tactics of this like? No. Why?
- It is dirty.
- Other services exist that offer much better alternatives.
- Having the window open doesn’t mean any of the ads will be seen. Better use other tactics.
- Only few users will read the “YOU MUST LEAVE THE WINDOW OPEN” notice, files will get corrupted, etc.
All comments and thoughts welcome.