We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32017
    • 151 Posts
    brand new install, cant get download counter working (main reason i wanted plugin) do i need that other plugin to make this work ! it doesnt say that in the instructions !
      London web design - MODx specialists
      • 11445
      • 3 Posts
      Quote from: gua at Jan 17, 2008, 02:49 PM

      There seems to be a problem with 0.9.6.1 and FileDownload.


      « MODx Parse Error »MODx encountered the following error while attempting to parse the requested resource:
      « PHP Parse Error »

      PHP error debug
      Error: array_values(): The argument should be an array
      Error type/ Nr.: Warning - 2
      File: /-snip-/modx-0.9.6.1/assets/snippets/filedownload/filedownload.class.inc.php
      Line: 260
      Line 260 source: $values = array_values($v);

      Parser timing
      MySQL: 0.0092 s (6 Requests)
      PHP: 0.0411 s
      Total: 0.0503 s

      Any ideas what might be causing this and how I might be able to debug it? Or is there a known fix available somewhere?

      Thanks.

      This seemed to be a problem with symlinks. So if you run into this one, you might wanna make sure you are trying to list existing directories wink
        • 12027
        • 63 Posts
        Hi, just wondered if there’s an example to make FileDownload generate something like in its screenshot?
          • 11190
          • 109 Posts
          Hello, all. I hope I am not raising an unnecessary alerts but this seems like a FileDownload problem (and sincere thanks to the developers - this tool is just what we need if we can work through this problem). We are using FileDownload snippet v2.5 and plugin 1.2.

          We’ve just put up a new site at http://www.spiritualoutreach.com with a download section that includes some very large videos - some several hundred megabytes. FileDownload does not seem to handle requests for multiple files from the same browser very well. It appears to wait until the first download is finished (which makes all the others time out) or, perhaps, waits until a significant amount of data is downloaded, then stalls that download and moves to another which eventually causes the first download to timeout. In fact, while one is downloading, one cannot even access any site pages including the main page in a separate tab in the same browser.

          If I start three separate browsers and download three different files, one at a time, simultaneously in each, all three download concurrently, quickly and with minimal overhead on the server.

          I’ve tried the downloadthemall firefox plugin and I’ve tried right click / save as approaches in both firefox and konquerer. We originally hosted this site on 1and1.com but we would either see download timeouts or we would see error 500 - server unavailable. 1and1 told us we were consuming too many resources on the shared server. I moved the site to a private server and I see minimal overhead even when doing the simultaneous downloads from different browsers.

          Not being a PHP developer, I’m at a loss at what to do but this is wreaking havoc on our site. Can anyone point me in the right direction to troubleshoot or resolve? Thanks very much - John
            http://www.spiritualoutreach.com
            Making Christianity intelligible to secular society
            • 22303 MODX Staff
            • 10,725 Posts
            Don’t serve these downloads with the FileDownload component; from my best guess, this is essentially exceeding the Apache time limit since PHP is executed by Apache and there is generally a maximum amount of time configured for Apache to wait for the PHP process to complete. PHP configuration may or may not also be involved, but if you bypass the PHP approach to downloading these files and simply make direct links to the files, your problems should go away.
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I think everyone tends to forget that we’re working with HTTP... HyperText Transfer Protocol. It was never intended to replace FTP... File Transfer Protocol. So there are times when HTTP will choke over moving large files.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 11190
                • 109 Posts
                Thank you very much. The explanation makes sense and I wonder if I can configure Apache for a longer timeout. I’m hesitant to not use FileDownload both for not wanting to expose the underlying directory structure but most importantly for the download counter. That’s important for both us and our clients. As you can probably tell, I am not only ignorant of PHP but a novice at web development in general. Is there a good alternative?

                I do understand about FTP but, this is a client driven site and I do not see asking them to use an FTP client to download files. It really needs to be point and click from the web page for the end user experience.

                I’m still perplexed by one thing, though. I can understand how the PHP timeout issue would explain the downloads truncating but why would that prevent simultaneous download from the same browser? Thanks again - John
                  http://www.spiritualoutreach.com
                  Making Christianity intelligible to secular society
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  If you have access to your Apache config file you can change the server timeout.

                  http://httpd.apache.org/docs/2.0/mod/core.html
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 11190
                    • 109 Posts
                    Oh, I’m sorry; I wasn’t clear. I meant a good alternative to the FileDownload snippet for file counts. Thanks for the link, though; it saved me having to look it up smiley
                      http://www.spiritualoutreach.com
                      Making Christianity intelligible to secular society
                      • 11190
                      • 109 Posts
                      Hmmm . . . this doesn’t seem to be a time out issue. I do have control over the current server and changed both the apache timeout value (to 1200 seconds from 120) and the php.ini resources values (18MB memory, 300 second execution). It did not solve the problem of multiple concurrent downloads. It almost seems like a threading or blocking issue. Is the FileDownload snippet/plugin supposed to allow multiple concurrent downloads to the same browser? Thanks - John
                        http://www.spiritualoutreach.com
                        Making Christianity intelligible to secular society