Something to count how many times form has downloaded

Hi there.
DW CS3, PHP mySQL
I want to put on my site a PDF document that people can
download.
I don't want to link this to my mySQL DB for the records to
be added in the
DB.
But, I want to see how many times this document has been
downloaded.
It's almost like "autonumber" in Access.
I will really appreciate any advise and direction on how to
accomplish
this.
Thanx so much.
Deon

Thanx Joe, I will check it out.
I'm quickly building the download page.
Deon
Joe Makowiec <[email protected]> wrote in
news:[email protected]:
> On 14 Oct 2008 in macromedia.dreamweaver, Deon H wrote:
>
>> I want to put on my site a PDF document that people
can download.
>> I don't want to link this to my mySQL DB for the
records to be added
>> in the DB.
>>
>> But, I want to see how many times this document has
been downloaded.
>> It's almost like "autonumber" in Access.
>> I will really appreciate any advise and direction on
how to
>> accomplish this.
>
> It's available in your logs. Just do a search for
"myfile.pdf", and
> look for lines which have a 200 status code. (Status
code of 206
> indicates a resumed download; you don't want to count
those.) A
> recent sample; details changed to protect the guilty:
>
> 192.168.4.246 - - [14/Oct/2008:01:56:04 +0000] "GET
> /documents/town20080911.pdf HTTP/1.1" 200 20101
> "
http://www.example.org/minutes.asp"
"Mozilla/4.0 (compatible; MSIE
> 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
192.168.4.246 - -
> [14/Oct/2008:01:56:04 +0000] "GET
/documents/town20080911.pdf
> HTTP/1.1" 206 18572 "-" "Mozilla/4.0 (compatible; MSIE
6.0; Windows NT
> 5.1; SV1; .NET CLR 1.1.4322)"
>
> The first field is the IP address that the request came
from
> The second is date/time (in this case, in GMT)
> The third is the request with protocol
> The fourth is status code[1] followed by bytes
transferred
> The fifth is referrer; the sixth is user agent
>
> More information:
http://www.w3.org/TR/WD-logfile.html
>
> [1]
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
>

Similar Messages

  • Counting how many times file is downloaded

    Hi,
    In my web application I need to set the limit say 10 times, a file can be downloaded by the user. After downloading 10 times I need to disable the download link. I am using javascript,
    ajax and spring framework and mysql .
    Problem is when the file is being downloaded if the user clicks on cancel button of browser download manager or if they closes the browser , download count is incremented though the file is not downloaded completely. I need to catch the events when the download is incomplete so that I should not increment the download count that time.
    Is there any way to solve this problem?
    Please help me.....

    I'm not sure if there's an easy way to do what you want to do.
    You could try using a Servlet to serve the file though. What you'd basically need to do is set up a servlet to take a "file" parameter, load up the file, and then send it to the output stream. Once that was done you could increment the file download count.
    So, in pseudo-code, what you'd be doing is:
    doGet(HttpServletRequest request, HttpServletResponse response)
      String filename = request.getParameter("filename");
      File f = new File(FILE_DIR + filename);
      if (downloadCount < MAX_DOWNLOAD_COUNT)
        // TODO: Create FileInputStream and write contents to response.getOutputStream()
       // If you're using Spring, looking into the FileCopyUtils class as this will make it much easier
       // Increment download count
        downloadCount++;
    }When someone clicks the "cancel" button on a download, you should find this closes the output stream, which will throw an exception and your download count will not be incremented. You might want to verify that though by testing it!
    Of course, in the interests of security you would need to check that the filename being passed in didn't contain any special characters (particularly backslashes or forward slashes).
    And I don't know how you're storing the download count, but of course you'd probably want to modify it so that it stored on a "per-file" basis!

  • Counting how many times my app has been opened

    I want to be able to count how many times a user has opened my application, and so every time the application launches, this number is added by one.
    Does anyone know how I store a long-time variable like this that will still need to be available across different runs of the application? I imagine this value would be stored in the application's preference file in Library, but I don't know how to do this.
    Can any of you please lend me some advice/code to achieve this (I am using Objective-C)?
    Thanks in advance,
    Ricky.

    Hi.
    It has been a while - but I finally got around to slapping some code together. I have successfully created and retrieved the value from the preference file, but for some reason, adding 1 to my value each run is not working. It only adds by one after each BUILD. So I have to rebuild it every time I want it to increment. See my code below;
    [NSUserDefaults init];
    int numberOfTimes;
    numberOfTimes = [[NSUserDefaults standardUserDefaults] integerForKey:@"used"];
    numberOfTimes = numberOfTimes++; //It is that that is not working.
    [[NSUserDefaults standardUserDefaults] setInteger:numberOfTimes forKey:@"used"];
    NSLog (@"%d", [[NSUserDefaults standardUserDefaults] integerForKey:@"used"]);
    I can't seem to stop anything wrong, but then again it is late.
    Do any of you see any errors here?
    Thanks,
    Ricky.

  • Hey! On excel I want to count how many time a text come back in the spreadshit (sum) thx, hey! On excel I want to count how many time a text come back in the spreadshit (sum) thx

    Excel:
    line of cellule with 3 different text. I want to count have many time a text come in the line... Thx for helping me, it is for my job!!

    Hopefully I am understanding your question.
    A typical way to count how many times a word appears in a line of text in a cell is to substitute spaces for the word, one less space than the length of the word. Example:
    A1 has the string "brown red brown green"
    A2 =LEN(A1) - LEN(SUBSTITUTE(A1,"brown","    "))  
    "brown" has five letters so there are four spaces in the substitution text)
    If you want to do several cells at once, counting the total number of times the word appears, concatenate the cells with a space between them
    A1 and A2 have text in them
    A3 =LEN(A1&" "&A2) - LEN(SUBSTITUTE(A1&" "&A2,"brown","    "))

  • How do you count how many times a if/when/for statement runs?

    So this new program I'm trying to write is a changemaker (in euros for some reason). You enter a price of a product, amount paid, and it computes how much change you should get back in the form
    [number] x 2-euro
    [number] x euro
    [number] x 20-cent
    etc
    Where the number is the number of that kind of coin they should get back.
    Right now, I have it so that you enter price, and amount paid, and then I have a series of while statements that go like..
    while (surplus > 2.00);
    while (surplus > 1.00);
    etc. If the surplus > 2, I want to add 1 2-euro coin to the count, subtract 2, and then recheck the amount and either add another 2-euro or go onto the next coin. Only thing is, I don't know how to count how many times a while statement ran until it was false. Or I could be looking at this the wrong way entirely. What's the best way to go about a program like this?

    Well I finally figured it out with lots of help from other students in the class. It was much easier than it appeared to be. Thanks for the hints everyone (especially joker for doing the coding for it) wow :D much appreciated ^^
    Heres the code that I came up with and it works matches the assignment's example:
    import java.util.* ;
    public class ChangeMaker {
         private static int changeA [] = new int [7] ;
         private static float changeVar[] = new float [7] ;
         private static int changeVarNumb[] = new int [7] ;
         private static String changeNames[] = new String [7] ;
         // initialize Scanner
         private static Float getInput (String prompt){
              System.out.print (prompt.concat(" ")) ;
              Scanner sc1 = new Scanner (System.in) ;
              return (sc1.nextFloat ()) ;
         // put the change variables and change names into arrays
         private static void moneyArray (){
              changeVar[0] = (float) 2.0 ;
              changeVar[1] = (float) 1.00 ;
              changeVar[2] = (float) 0.20 ;
              changeVar[3] = (float) 0.10 ;
              changeVar[4] = (float) 0.05 ;
              changeVar[5] = (float) 0.02 ;
              changeVar[6] = (float) 0.01 ;
              changeVarNumb[0] = 2 ;
              changeVarNumb[1] = 1 ;
              changeVarNumb[2] = 20 ;
              changeVarNumb[3] = 10 ;
              changeVarNumb[4] = 5 ;
              changeVarNumb[5] = 2 ;
              changeVarNumb[6] = 1 ;
              changeNames[0] = (String) "Euro" ;
              changeNames[1] = (String) "Euro" ;
              changeNames[2] = (String) "Cent" ;
              changeNames[3] = (String) "Cent" ;
              changeNames[4] = (String) "Cent" ;
              changeNames[5] = (String) "Cent" ;
              changeNames[6] = (String) "Cent" ;
              return ;
         // calculate the change the user is going to receive
         private static void calcChange(float diffAmount) {
              for (int i = 0; i < changeVar.length ; i++) {
                   if (diffAmount > changeVar) {
                        changeA[i] = (int)(diffAmount / changeVar[i]);
                        diffAmount = diffAmount - (changeA[i] * changeVar[i]) ;
                        System.out.println(changeA[i] + " x " + changeVarNumb[i] + " " + changeNames[i]) ;
              return;
         // output
         public static void main(String[] args) {
              float itemPrice = getInput("Enter product price: ") ;
              float amountTendered = getInput("Enter amount paid: ") ;
              float diffAmount = amountTendered - itemPrice ;
              System.out.println() ;
              System.out.println("Your change is " + diffAmount + " euros") ;
              moneyArray() ;
              calcChange(diffAmount) ;
    And the output looks like this:
    Enter product price:  2.32
    Enter amount paid:  5.00
    Your change is 2.68 euros
    1 x 2 Euro
    3 x 20 Cent
    1 x 5 Cent
    1 x 2 Cent
    1 x 1 Cent                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How many times can you download a song on iTunes and have it count?

    I'm wondering. Someone I like have released a song on iTunes and I wanna support them and I dont mind spending a few bucks on them.
    So how many times can I download a song and still have it count as an individual purchase? And what about gifting?
    thanks.
    -andy.

    As Polydorus said, get only one download per purchase for anything you buy from the iTunes Store other than iOS apps or iBooks. I'm not sure what you mean by "individual purchase" or what you are asking in reference to gifting.
    Regards.

  • How to count how many times the caller calls by using UCCX script?

    Hi there,
    My customer wants to do a few changes for their script as below:
    At the beginning of the script they are planning to add a new menu item, it will announce their new privacy policies and to continue the user must press the number one to continue to the Welcome.  If they do not press 1 then the message should repeat itself and if they again do not press 1 they should be transferred over to a live operator who will explain things and then be able to transfer them back to the message so that they can press 1 and continue.
    I modified their script as attached file, but i don't know how to count how many times the caller calls in "Get Reporting Statistic".
    Any helps would be appreciated.
    Thanks.

    Hi Aaron,
    At beginning, i want to use a variable to get number of mistake for the same caller, then we will send the call to right place to fulfill the customers' needs. 
    Do you have any suggestion for the new posted script?
    Thanks.

  • How to count " How many times the ' commit work ' Statement is executed.

    Hi all sap Champions,
    One of the client requirement, That is
    How to count " How many times the ' commit work ' Statement is executed.
    It's urgent.
    Please can anybody help me for this.
    Thanks
    Basu

    hi,
    when report try like this.
    declare a variable as
    data: counter type i value 0.
    COMMIT.
    counter = counter + 1.
    write:/10 counter 'NO. OF TIMES COMMIT WORKED'.

  • How many times can i download 2.1?

    I bought a 2.1 update in the itunes store on my computer. But it has been download for many times and never succeed. So i wanna know whether downloading it for several times costs more money? And how many times can I download it?

    I can't speak directly about 2.1, but iTunes should give you an alert that you've already download the app. It shouldn't bill you again. It should still be on your computer.
    What do you mean "it has been downloaded (sp.) many times and has (sp.) never succeeded (sp.)"? What was it unsuccessful in doing?

  • How many times can I download Quick Time Pro once I purchased it?

    Last September I purched my update to Quick Time Pro. Now I bought a new Computer and re-formatted the old one, not being able to copy Quick Time Pro from the old to the new computer. Therefore I wanted to download again Quick Time Pro: In the settings window I introduced my program key and then "accepted". It said "Quick Time pro" below the registration line; however, the "apply" buttom was not operative. I checked and my Quick Time version was still "Quick Time 7", not Pro. My question is: how many times can I download Quick Time Pro once I purched it? If I can download it more often than once, how do I proceed? Thank you for your help.

    I started this thread:
    http://discussions.apple.com/thread.jspa?threadID=2454706&tstart=0
    but I'm afraid it's so involved that thus far, nobody has "touched" it.
    However, PART of my problem is similar to THIS person's.
    My problem is that I have QT on two different drives in one computer; the one I paid for [QT Pro?] and one I got for free; QT7. I fear the free QT7 might have "interfered" with my "Pro".
    So, taking your advice above, looking in the "Help" "About" menu, I find that BOTH of mine another "offer" above the word "About"; they suggest that I "Purchase QT Pro"...... so now, if BOTH of my QT's say THAT, then may I conclude that I do NOT have the Pro version? I'm meaning to say that if I already HAVE the Pro, they wouldn't suggest that I go and "Buy QT Pro".... right? Is this a safe conclusion? for ya'll that HAVE the Pro, and KNOW it, does it suggest to you that you could go and "purchase QT Pro"?
    Thanks,
    LarryR : )

  • How many times can you download

    hello
    how many times can i download the creative cloud set up?

    HI Philippa,
    You may install software on up to two computers. These two computers can be Windows, Mac OS, or one each.
    If you install on a third computer, it will request you to de-activate on the other two computers. You can then reactivate one of the previous two computers, and use Creative Cloud apps on it.
    If you regularly need to use the Creative Cloud on more than two computers then it would be best to purchase an additional subscription.
    An advantage though for Creative Cloud over the perpetual product is that you can install on Mac and Windows with the same subscription!
    Thanks,
    Ratandeep Arora

  • How many times can I download from Adobe Creative Cloud, and on how many computers

    I just purchased a one month plan from Adobe Creative Cloud and already downloaded several programs.  Unrelated to Adobe, I reinstalled the operating system on my computer today.  I just downloaded the programs again.  Is there a limit on how many times I can download Adobe software?   I also am planning on purchasing another computer down the road.  How many computers can I download Adobe software from my current Adobe Creative Cloud membership. 
    Thanks-

    You can download and install it as many times as you like but you must activate it in order to use it.
    You can only activate the software on a maximum of two computers at any one time.
    You can deactivate on a computer via Help > Deactivate and re-activate via the same step.

  • How many times can i download photoshop or lightroom?

    hi how many times can I download photoshop or lightroom? I bought and downloaded them onto my lap top but want to put it onto a pc can I do that? or is it a one time down load only

    You have 2 activations, so yes, you can use it on both systems.
    Mylenium

  • How many times can I download my music from icloud

    How many times can I download music from Icloud?

    Welcome to the Apple Community.
    You can download it as many times as you want.

  • How many times can I download this product??

    I got photoshop elements 10 for Christmas. How many times can I download it onto computers??? Can I put it on multiple computers??

    If you mean how many times can you install it, your license lets you install it on two computers. If you want to install it on more computers than that, you'll need to deactivate one of the installs (Editor>Help>Deactivate).

Maybe you are looking for

  • Help Needed! To upload image to db2 using struts & hibernation[code inside]

    Hi all, currently i have successfully created the application for inserting text data into my db2 through the use of struts with hibernation. But i need to insert image now which seems to be different from just inserting text data. From my understand

  • Filter condition in query designer

    Hi Friends, Can any one please tell me? Query is done on Multiprovider (made of Cube 1 to Cube 6 ) and in query designer under filter tab i have seen case 1: 1) Fiscal year variant F4 2) Cube 1 Questions: 1) what is the use of Fiscal year variant F4

  • Auto Resize of Web Analysis Screen

    <p>Is it possible to get web Analysis to resize its self based onthe screen resolution of the PC.</p><p> </p><p>Problem is screens designed in one size but useres havedifferent resolutions so graphs miss the bottom axis off and noscroll bar available

  • Performance Test - Massive data generation

    I would like to generate a massive quantity of date in SAP ERP, to be extracted by SAP BW, in an effort to create a baseline Volume of 1-2 TB of data for a performance Test Activity in BW. We're investigating tools like Quest's DataFactory which gene

  • File explorer for 5530

    can somebody tell me where can i find or where can i download a file explorer app. for my 5530.. thanks in advance