We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11190
    • 109 Posts
    Hello, all. Another newbie showing his newbiness here. I am using MODx 0.9.6, FileDownload snippet 2.5 and FileDownloadPlugin 1.2.

    FileDownload snippet is working fine if I disable the plugin. However, whenever I activate the plugin, it behaves as if it is either not being passed the file path or is being passed an incorrect path in that it simply redisplays the download page.

    My snippet call is very simple:
    [!FileDownload!]

    My FileDownloadPlugin TV is set to:
    assets/media/VideoTraining

    The download list is displayed perfectly fine so it is finding the directory. The URIs are something like:
    http://iscs.opensourcedevel.com/develtraining.html/ISCSTrain1st-IntroAndiputilities.avi

    I am using friendly URLs. Use friendly alias path is set to No. No suffix or prefix is set. Use friendly aliases is set to Yes. Allow duplicates and automatically generate alias are set to No. I have changed my rewrite rule from:
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    to:
    RewriteRule ^([^/]*)/?(.*)$ index.php?q=$1&d=$2 [L,QSA]

    I’m not quite sure what the author means by:
    Warning! Friendly URLs work only with flat document aliasing structure setting Use friendly alias path: No and therefore won’t work for: http://www.mymodxsite.com/en/products/downloads.html/myzipfile.zip

    The download document is a second tier document. I tried moving it to a top level document but I get the same results.
    What am I doing wrong? Thanks - John
      http://www.spiritualoutreach.com
      Making Christianity intelligible to secular society
      • 20349 ☆ A M B ☆
      • 453 Posts
      FileDownload snippet is working fine if I disable the plugin.  However, whenever I activate the plugin, it behaves as if it is either not being passed the file path or is being passed an incorrect path in that it simply redisplays the download page.


      I have the same problem and I just turned off the plugin.... embarrassed
        BASE - Web Design Studio
        MODX Ambassador

        Website
        • 11190
        • 109 Posts
        Thanks, but I’d really rather not do that. The author raises some valid points about the security issues of the snippet. I really don’t want users knowing the internal file structure. Can anyone see how I’ve misconfigured the plugin? I’d really like to use it. Thanks - John
          http://www.spiritualoutreach.com
          Making Christianity intelligible to secular society
          • 2912
          • 315 Posts
          If you are confused about the part of the Friendly URL path then check the managers Configuration section under Friendly URL’s. Ensure Use Friendly URL Paths is set to NO.

          I’ve found that directory names in the TV must be case correct to your server folder.

          Try the following rewriterule:

          RewriteRule ^([^/]*)/?(.*)$ index.php?q=$1&d=$2 [L,QSA,NC]
            BBloke
            • 11190
            • 109 Posts
            Thanks. However, I did disable "Use friendly alias path" and that is the rewrite rule I am using. The case of the directory appears correct because the snippet, replying upon the plugin, finds the files. However, when I click on a file, all I get is a reload of the download page.

            Has anyone successfully used the plugin and snippet together? Can anyone see something wrong in my configuration? Thanks - John
              http://www.spiritualoutreach.com
              Making Christianity intelligible to secular society
              • 2912
              • 315 Posts
              I have them both working and I’ve also seen the problem you are having.. I’m trying to rack my grey cells to remember what I did. One of the things I remember was removing the trailing slash from the directory TV (Which I see you have already done)

              Here’s is my site: http://www.montydan.com/Movies with it working and the call is:
              [!FileDownload? &dateFormat=`d-m-Y` &imgLocat=`assets/images/filetypes` &imgTypes=`FileDownloadImage` &tplList=`FileDownloadTPLMovies` &downloadGroups=`Registered Users,Site Admins` &noDownload=`Please register to download`!]


              Have you tried it with FURLs off and no rewrite?

              Just as a thought have you checked your plugin to make sure you have removed the <? ?> from the start and end of it?

                BBloke
                • 11190
                • 109 Posts
                Ah, <? ?> was it. I braincramped when I read those instructions and assumed that was a caution against duplicating the tags that were automatically inserted when creating a new plugin. That was the brain cramp - they are automatically inserted in a new snippet but not a new plugin. Once I removed them, it worked as advertised. Thanks for the help and I hope documenting it here will save some future brain cramper! - John
                  http://www.spiritualoutreach.com
                  Making Christianity intelligible to secular society
                  • 2912
                  • 315 Posts
                  Glad to hear its working. smiley
                    BBloke
                    • 2632
                    • 18 Posts
                    i was just wondering around trying to figure out the problem with my FileDownloadPlugin then i found this thread you guyz are the great it solved my problemo instantly thank guys
                    thanks</br>