We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29181
    • 480 Posts
    Quote from: zi at Jul 08, 2007, 01:55 PM

    Quote from: Tom at Apr 27, 2007, 05:17 AM

    More important now: Deleting a file works as a charm, but when trying to delete a file form a subdirectory, I get:

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


    I am having the same problem too. I am using:

    Filedownload snippet 2.5 beta with FileDownload Plugin 1.2

    MODx 096 on LAMP with Apache 1.3.x Server API CGI/FastCGI, PHP 4.4.7, MYSQL 4.1.x

    Additionally adding a debug line in the class file gave me this on top of MODx error:
    Array (     [0] => The path specified is not a directory: files/clients/name/MDgtMDctMjAwNw== )
    


    Any fixes?

    Thanks.

    Did you find a solution to this problem Zi? I’ve bumped into it too...
      Adrian Lawley: www.adrianlawley.com
      • 15987
      • 786 Posts
      I’m going to be working on this this weekend. So hopefully I’ll have it fixed soon smiley
        • 33337
        • 3,975 Posts
        Zaigham (aka zi) Reply #133, 19 years ago
        @Taff: not yet, but it seems its gonna be solved soon wink

        @kylej: Thats great news man! Looking forward to it.

        regards.
          Zaigham R - MODX Professional | Skype | Email | Twitter

          Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • 29181
          • 480 Posts
          Thanks to you both
            Adrian Lawley: www.adrianlawley.com
            • 15987
            • 786 Posts
            I have posted a new version in the repository,

            http://www.modxcms.com/FileDownload-502.html


            here are the changes:


            • Fixed error when deleting files in a sub-directory.
            • Added new parameter hideExt. This allows specified extensions to be removed from the output. (The parameter showExt takes precedence over this parameter)
            • Changed both hideExt and showExt parameters to accept a comma delimited list of extensions.


            I tried to find my list of needed changes, but to no avail. If there is anything anyone would like to see or need added to this snippet let me know.
              • 29181
              • 480 Posts
              Thanks for your time on this Kyle...and some great snippets smiley
                Adrian Lawley: www.adrianlawley.com
                • 2912
                • 315 Posts
                Thanks for the changes. It would be nice to have realtime security checks when downloading a file.

                At the moment the download link is hidden when you cannot download but I found that if someone gets a hold of the download URL and posts it elsewhere then the file can be downloaded freely without javascript popup.

                I did a dirty hack to prevent this happening on my site as all the downloads are restricted but its not a good solution for me.
                  BBloke
                  • 33337
                  • 3,975 Posts
                  Zaigham (aka zi) Reply #138, 19 years ago
                  Thank you very much Kyle!

                  Its working great.
                    Zaigham R - MODX Professional | Skype | Email | Twitter

                    Digging the interwebs for #MODX gems and bringing it to you. modx.link
                    • 29181
                    • 480 Posts
                    Quote from: BBloke at Sep 09, 2007, 08:45 AM

                    Thanks for the changes. It would be nice to have realtime security checks when downloading a file.

                    At the moment the download link is hidden when you cannot download but I found that if someone gets a hold of the download URL and posts it elsewhere then the file can be downloaded freely without javascript popup.

                    I did a dirty hack to prevent this happening on my site as all the downloads are restricted but its not a good solution for me.

                    I was having the same problem, I changed the permissions for the directory that contains all my downloads to 740 and through the browser at least it would appear that they are safe. If I’m logged in thru ModX as a web user I can still download them.

                    The question is of course...is it safe, or or is there another method that is?

                    Thanks,
                    Taff
                      Adrian Lawley: www.adrianlawley.com
                      • 2912
                      • 315 Posts
                      I did it this way so the downloads couldn’t be done without being logged in:

                      http://modxcms.com/forums/index.php/topic,17698.msg111193.html#msg111193
                        BBloke