We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I’m having problems getting the counter working... Basically if I click the download link, the file downloads fine but is not counted. If i’m in the manager and save the download document it initiates the download and the count is taken. IS there a reason that the link on the webpage does not count but if saved in the manager it does?

    I have a file called
    My call.

    <h2> <a href="[~220~]">COD4 patch-1.6-1.7</a></h2>
    [[FileDownloadPE? &action=`count` &filename=`cod4.zip`]]

    my download document settings

    id is 220
    template : Downloads
    alias : cod4.zip
    published : yes
    log visits : yes
    Empty cache ; yes

    Content Type plain/text
    Content Disposition : attachment


    FileMime : force/download
    file : assets/useruploads/files/cod4.zip


    Any help would be great. Thanks



      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
      AugmentBLU - MODX Partner

      BLUcart - MODX Revolution E-Commerce & Shopping Cart
      • 26435
      • 1,193 Posts
      Ross, what path or URL is showing up in the status bar of the browser when you hover over the download link? Is it what is expected? (The actual URL to the document acting as a downloadable file?)

      Also, What happens if you intentionally go to the URL of the cod4.zip document? It should start downloading immediately AND increment the counter.

      -sD-
      Dr. Scotty Delicious, DFPA.
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 34017
        • 898 Posts
        Hey Scotty,

        Have you thought about creating a parameter that allows an external snippet to be the file authentication kind of like eForm does?

        ie &ext_authenticate=`my_validation_snippet`

        Then my validation snippet could say ’if user is in external database or if file’s TV is free download then go. Else no authentication’

        Chuck
          Chuck the Trukk
          ProWebscape.com :: Nashville-WebDesign.com
          - - - - - - - -
          What are TV's? Here's some info below.
          http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
          http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
        • Quote from: Dr. at Jul 20, 2008, 03:50 PM

          Ross, what path or URL is showing up in the status bar of the browser when you hover over the download link? Is it what is expected? (The actual URL to the document acting as a downloadable file?)

          Also, What happens if you intentionally go to the URL of the cod4.zip document? It should start downloading immediately AND increment the counter.

          -sD-
          Dr. Scotty Delicious, DFPA.

          Sorry for the late reply!

          When I hover over the download link the link is in the status bar and is showing the correct link.
            Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
            AugmentBLU - MODX Partner

            BLUcart - MODX Revolution E-Commerce & Shopping Cart
            • 10
            • 16 Posts
            Hello, i have everything installed ok,
            It is counting the downloads, and the zips are downloading
            The only problem is, there is more then one download on the page
            And after the first download which always works, if the page is not refreshed
            then the second, third etc.. download comes up with a file size of 0 and a corrupted file
            I was wondering if there was anyway around this?
            or do i just need to add a note to the page that if the file comes up empty to refresh the page and try again?
              • 31471
              • 206 Posts
              or do i just need to add a note to the page that if the file comes up empty to refresh the page and try again?
              well. just how do you refresh the page and try the download again?
              Since the download is in a header, I could not do anything else on the same page, for example to refresh it.
              You know: one source for one header only!
                • 10
                • 16 Posts
                Thanks for asking...

                Quote from: vhollo at Aug 22, 2008, 12:25 AM

                well. just how do you refresh the page and try the download again?
                Since the download is in a header, I could not do anything else on the same page, for example to refresh it.
                You know: one source for one header only!

                ok, here is the page

                http://www.deviantdesigns.org/index.php?id=107
                I hit the refresh button on the browser to reload the page
                then i hit the link again to download
                Which ever download i do on the page first downloads correctly for me
                and everyone after that is empty, unless, I download one
                Reload the page and download the next, then reload the page again
                etc etc etc etc


                I just figure my visitors will get frustrated if they have to reload the page after each download
                So if possible, i would like to fix this
                  • 31471
                  • 206 Posts
                  It seems to work for me. However, using a download accelerator (like GetRight), can be problematic. Do you get that error without it?
                  Sorry, in my previous post I wanted to say that I’m currently stuck with refreshing the download page after downloads.
                    • 20751
                    • 122 Posts
                    Feedback...

                    Didn’t work at first for me. On inspecting the code i notice that the readfile() function is used which is disabled on many servers (including mine) during server "hardening" offered by many server admin companies typically found on the web.

                    I used an fopen/fpassthru/fclose work around instead. Now works perfectly!

                    Also, the documentation mentions having no suffix auto added to the file name... if you’re using Strict SEO’s plugin, just set your seoOverride to "Base Name".

                    Fantastic snippet Scotty!
                      • 31471
                      • 206 Posts
                      Quote from: myan24 at Aug 28, 2008, 06:33 PM

                      I used an fopen/fpassthru/fclose work around instead. Now works perfectly!

                      Also, the documentation mentions having no suffix auto added to the file name... if you’re using Strict SEO’s plugin, just set your seoOverride to "Base Name".
                      I’m sorry, could you explain these a bit more?
                      1. What’s your ’fopen/fpassthru/fclose’ workaround is for? The download-accelerator issue? If so, isn’t the real file URI passed thru then? And how is it programmed?
                      2. What ’Strict SEO’s plugin’ you mean? What ’seoOverride’ setting? Where?

                      I’m really sorry my stupid questions.
                      I’m using the FileDownload snippet in pair with it’s Plugin but since that plugin stops browsing ’till the end of the download, I changed the download function in the plugin to Scotty’s function. So if there’s any possible problem with the readfile() command when moving to a public server, I would like to know of it’s workaround!

                      Thanks for your answer if you do!