8 Replies Latest reply on Feb 3, 2009 5:13 PM by sherler8

    Download File counter

    sherler8
      Seems like a simple issue, but I can't get the 'Enable Download Counter' to update the assigned field in the database. The 'download Counter' field is an INT and doesn't update incrementally with each download? Thanks for any ideas?
        • 1. Re: Download File counter
          Günter Schenk Level 4
          Hi Sherle,

          just checked it myself, and it works for me. But I noticed that the very first download attempt of whatever file will only get incrementally counted when your download counter field´s "Standard" attribute has been defined as "0" (zero) instead of NULL (blank) -- wonder if this is the reason for your issue too

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Download File counter
            sherler8 Level 1
            By 'Standard' attribute, do you mean 'Default'? I inserted a '0' into the download counter field and changed to 'NOT NULL' and still no incremental increase with each download? The file download itself works fine, just doesn't count?

            Thanks for your help.
            Sherle
            • 3. Re: Download File counter
              Günter Schenk Level 4
              Hi Sheri,

              yes, that´s what I meant, although changing the column to NOT NULL does not affect the counter at all.

              Can you upload the page code on your server as .txt file and post a link to this file ?

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: Download File counter
                sherler8 Level 1
                Gunter,

                http://www.p2clinic.com/libraryDetail2.txt

                Many thanks,
                Sherle
                • 5. Re: Download File counter
                  Günter Schenk Level 4
                  Hi Sherle,

                  I think I found the error -- look at the line:

                  $downloadObj1->setPrimaryKey("product_id", "NUMERIC_TYPE", "productID");

                  As "productID" is the URL variable you´re passing to this page, you´ll need to reference this one by using ADDT´s Dynamic Data placeholders, which in this case would have to be:

                  {GET.productID}

                  The modified line would then read:

                  $downloadObj1->setPrimaryKey("product_id", "NUMERIC_TYPE", "{GET.productID}");

                  Works better now ?

                  Cheers,
                  Günter Schenk
                  Adobe Community Expert, Dreamweaver
                  • 6. Re: Download File counter
                    sherler8 Level 1
                    Ah brilliant..works now! Magic is in the details.

                    Thanks very much!
                    Sherle
                    • 7. Re: Download File counter
                      Günter Schenk Level 4
                      -----
                      Ah brilliant..works now!
                      -----

                      cool :-)

                      I reckon you just entered the name of the URL variable in the behaviour´s "Primary Key equals" field, what will never work -- better use the lightning bolt to the right to select the desired data source (e.g. URL parameters, Recordset fields) and have ADDT insert the adequate placeholder

                      Cheers,
                      Günter Schenk
                      Adobe Community Expert, Dreamweaver
                      • 8. Re: Download File counter
                        sherler8 Level 1
                        Yes...dangerous to mess directly with the code after too many coffees!

                        Thanks for your time,
                        Sherle