We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • That would be cool for those who have files stored else where that would like to use the counter...

    I like the snippet how it’s meant to work... works great.

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

      BLUcart - MODX Revolution E-Commerce & Shopping Cart
      • 23383
      • 138 Posts
      I’m just curious about something (not directly related to the snippet). What does the "self::" bring compared to "this->" ?
        • 28033
        • 925 Posts
        This requires to set up each download individually, right (unlike FileDownload, which grabs all of the files in a folder)?
          My Snippets
          -> PopUpChunk v1.0
          • 26435
          • 1,193 Posts
          Quote from: Pikachu at Jun 20, 2008, 09:25 AM

          I’m just curious about something (not directly related to the snippet). What does the "self::" bring compared to "this->" ?
          The class is static (it is never instantiated). When a class is static, "self::" is the way to access members, but more specifically, for static methods to access other static methods and properties.

          Quote from: Soshite at Jun 20, 2008, 11:40 AM

          This requires to set up each download individually, right (unlike FileDownload, which grabs all of the files in a folder)?
          That is correct Soshite.

          -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
            • 5091
            • 332 Posts
            I followed every step, but when I tried to upload a file, it gives me this error:

            Error, "Failed to upload file, internal error..."

            What would be the possible cause?  The file upload browser is FCKEditor, I don’t have it installed, and had turned the tinyMCE off. Does this matter?

            Thanks!
              • 26435
              • 1,193 Posts
              Quote from: chinesedream at Jul 13, 2008, 01:47 PM

              Error, "Failed to upload file, internal error..."

              A few suggestions...
              Check the permissions on the folder you are trying to upload to. It may have to be set to 0777

              In the MODx Manager, go to Tools > Configuration > Interface & Features: Check the resource path.

              Check Reports > System Info > phpinfo: and look for the "file_uploads" directive under PHP Core. For this snippet to work, this directive needs to be on.

              -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
                • 5091
                • 332 Posts
                Hi Scotty, thanks for the suggestions.

                Under Media Temple’s server
                resource path : Checked - it was default (serverpath/assets/)
                Permission was 755, but I changed it to 777.

                "file_uploads’ is on.

                In the Resource browser, it says I have no permission to create folder, but I am logged in as admin.

                I FTP a few files in the folder, when I check that page, I see a ’0’, so I guess your snippet is working but something is wrong with system or config? My modx version is the latest, just upgraded it yesterday.


                I tried the snippet on client’s hostgator server
                I am able to create folder, when I tried uploading (PDF and JPG), it shows this error: Disallowed File Type
                  • 2912
                  • 315 Posts
                  Another great snippet Scotty.

                  I use FileDownload with the plugin quite a lot and I like it but for two slight technicalities: You can’t download and browse at the same time and the counter goes up if the download is cancelled before completion.

                  How does your counter.. well... er count and can you still browse the site if you are downloading?

                  Thanks and S! again. I’m sure this will be as popular as webloginpe.

                    BBloke
                    • 26435
                    • 1,193 Posts
                    Hey BBloke.

                    You should be able to continue browsing, but I have never run into that problem before, so test it for me and let me know.

                    The download is counted when the file is requested and the file transfer is initiated. If the user cancels, there is no signal sent back to the browser that could be acted upon to undo the counter increment. Sorry.

                    -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
                      • 2912
                      • 315 Posts
                      Hi Scotty,

                      After diving in I hit a bit of a stumbling block. Not through your snippet but how I’ve been using an alternative. I love the condensed nature of your code and its simplicity. What I have at the moment is a website that uses FileDownload and plugin where I can use the same code across many pages within a specific range of documents. This is excellent as it allows a beginner to create a page via "add a blog" and the addition of the default comments chunk at the end maintains the ability to access individual or multiple files for downloading depending on the given TV folder variable. Unless I’m missing something then I would need a unique page per modx page in order to link to a download. Thats twice as much work. I’m hoping and pretty sure I have this wrong as its late and I lacking a heap of sleep.

                      I guess I’m looking for my own ideal way close to what I have already minus the limitations.

                      S! and thank Scotty
                        BBloke