CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
How to control downloading file ?

 



mondo90
Novice

Feb 3, 2012, 9:21 AM

Post #1 of 10 (3403 views)
How to control downloading file ? Can't Post

Hello, I want to do script which will control downloading file from server. I mean script which can check whether file donwloaded completely ?


Can anyone give me any idea ? ;)


histrung
Novice

Feb 3, 2012, 1:59 PM

Post #2 of 10 (3395 views)
Re: [mondo90] How to control downloading file ? [In reply to] Can't Post

Do you mean "downloading" like FTP?


mondo90
Novice

Feb 3, 2012, 2:31 PM

Post #3 of 10 (3391 views)
Re: [histrung] How to control downloading file ? [In reply to] Can't Post

No, via web browser,

I mean that I uploaded file on my private server and I gave few friends link to download-file. The script which I want to do should count when file was download completely.

Any idea ? THANKS ! Blush


wickedxter
User

Feb 4, 2012, 12:23 PM

Post #4 of 10 (3378 views)
Re: [mondo90] How to control downloading file ? [In reply to] Can't Post

i have an idea that might work....

you can make a script to hide the file like the person has to enter a passcode to download the file and once the link is clicked you can count that.

blah.com/downloader.pl?file=somefile.zip


mondo90
Novice

Feb 4, 2012, 1:45 PM

Post #5 of 10 (3373 views)
Re: [wickedxter] How to control downloading file ? [In reply to] Can't Post

Wrong, I don't want to know how many times users click download button but how many times they downloaded file completely. The key word here is filesize, i.e if filesize is eq to 20 Mb my script should count only when user downloaded 20 Mb of this file (no broken downloads).


Zhris
Enthusiast

Feb 4, 2012, 3:10 PM

Post #6 of 10 (3367 views)
Re: [mondo90] How to control downloading file ? [In reply to] Can't Post

Hi,

In many cases, counting the number of times the download link was clicked would be sufficient, especially as a "boosted count" will often be desired when displaying to users.

In your case, you require an accurate/reliable count. It should be possible to parse the log file on your server which stores downloads. This also has its issues, i.e. if the user is using a download manager which breaks the download up into chunks, therefore producing multiple records in the log. You could design your code to recognize/handle if multiple records per download, but I don't think you would ever be able to guarantee 100% accuracy.

If you were letting users i.e. download your own written software, I would consider sending a request to the server when the program is opened for the first time, incrementing the count. But I doubt this is relevant in your case.

In conclusion, consider why you need an accurate/reliable count / what will the resultant data be used for / is there room for error at all.

Chris


mondo90
Novice

Feb 4, 2012, 3:25 PM

Post #7 of 10 (3362 views)
Re: [Zhris] How to control downloading file ? [In reply to] Can't Post

Zhris, you are right in many cases site owners want to boost number of downloads but it's not my goal. I need really accurate counter because only fully completed downloads will be important for me.

Still haven't got clear idea how to count this downloads. I think that key thing here is to get information from downloading-user sesion and compare it to file-info. But the question is how ?


Zhris
Enthusiast

Feb 4, 2012, 3:34 PM

Post #8 of 10 (3360 views)
Re: [mondo90] How to control downloading file ? [In reply to] Can't Post

Hi,

You still haven't fully provided an explanation for why you need an accurate count. You state you want to recognize fully completed downloads, but why, what will you use the resultant count for (not that its any of my business, but do you "really" need it, why is it so important for you). The way I view it is, even if they downloaded the file, whos to say they will open it anyway, which is surely more important.

The information on the download can be found in your server logs. This can be compared with the file info. More info can be found @ http://blechtrottel.net/en/downloadsmdb.html, who provide a solution.

Chris


(This post was edited by Zhris on Feb 4, 2012, 3:37 PM)


mondo90
Novice

Feb 5, 2012, 2:57 AM

Post #9 of 10 (3329 views)
Re: [Zhris] How to control downloading file ? [In reply to] Can't Post

I want recognize only full completed downloads because I'll pay for it. At this moment I have a solution to compare file-size from db with apache log but how to get downloaded size from apache ?


Zhris
Enthusiast

Feb 5, 2012, 6:45 AM

Post #10 of 10 (3317 views)
Re: [mondo90] How to control downloading file ? [In reply to] Can't Post

Hi,

I was under the assumption that only completed downloads would be logged, but I could be wrong. If thats the case, you wouldn't necessarily need to compare against filesize. If you do need to compare against filesize (i.e. broken downloads), i'm not sure, sorry.

Chris

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives