We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29877
    • 35 Posts
    Quote from: myan24 at Aug 14, 2009, 07:09 AM

    Hi,

    It didn’t work for me right away either. It is usually a conflict issue with Phx. Do you have that plugin installed? If you do just try and disable it to see if this fixes the issue. If it does fix the issue, re-enable it and I will show you how to resolve matters without having to diable Phx permenantly.

    I’m not familiar with the Phx plugin, nor do I see it listed in my plugins within my manager. I can only assume that we don’t have that installed.

    What makes absolutely no sense to me, is why most documents work, while others do not. I’ve tried to go in and find out what one setting might be in there that doesn’t belong. But this isn’t even likely, due to the fact that when I tested this and created one working document, I duplicated each one after. Then I just changed the location and/or filenames involved.

    I haven’t been able to dig into the code and find anything astray. I hope that someone can help me figure this one out soon. I really do NOT want to rip it out and start over with unsecured links for every document I have.

    Someone? Please? smiley
      • 31471
      • 206 Posts
      When a file is corrupt it doesn’t matter you use FiledownloadPE or just an ftp client.
      Randomly corrupted files occured for me when the memory modules failed in the server.
        • 29877
        • 35 Posts
        Quote from: vhollo at Aug 14, 2009, 02:22 PM

        When a file is corrupt it doesn’t matter you use FiledownloadPE or just an ftp client.
        Randomly corrupted files occured for me when the memory modules failed in the server.

        If that was the case, wouldn’t it a bit more inconsistent on which documents it fails to work on?

        I originally thought that maybe the files were not being uploaded correctly to the server. I have no problems going directly to the file’s primary URL and it downloading/opening correctly. It’s only on certain items while using FDPE, and consistently the same ones.

        I hope there’s a better explanation.
        • Is there a consistent difference in the filenames of the files that fail from those that don’t?
            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
            • 30087
            • 23 Posts
            In my case the PHx plugin does corrupt the downloads. When disabled the downloads (in my case pdf files) are downloaded correctly. Enabled renders them unreadable.

            If someone can show me a workaround for this issue without having to disable te PHx plugin entirely would be very appreciated. Myan24?

            thanks in advance
              • 29877
              • 35 Posts
              Quote from: sottwell at Aug 23, 2009, 05:48 PM

              Is there a consistent difference in the filenames of the files that fail from those that don’t?

              Thank you for following up on the issue with me. I’ll give some real world examples that I’m dealing with, as I am still playing with this and still having troubles.


              Path to some files that DO save/open correctly:

              assets/files/about_us/press_and_media/media_kits/style_guide.pdf
              assets/files/customer_resources/uncategorized/pd_-_order_form.xls
              assets/files/customer_resources/product_and_promotional_items/login_bookmark_-_standard.pdf


              Path to some files that DO NOT save/open correctly:

              assets/files/customer_resources/how_tos/content_partner_resources_overview.pdf
              assets/files/about_us/press_and_media/media_kits/logos/color/nT_logo_-_color.eps
              assets/files/about_us/press_and_media/media_kits/logos/color/nT_logo_-_color.psd
              assets/files/about_us/press_and_media/media_kits/logos/color/nT_logo_-_color.tif



              In reference those that DO NOT save/open correctly I have varying ways in which they appear corrupt. In the example I showed in my first post, the PDF would open and some of the images contained withnn were being displayed INcorrectly. In another PDF, the document would NOT even open in Acrobat. I received the error message "Insufficient Memory."

              This also isn’t limited to PDFs. When I tried to open an EPS image file into Photoshop, I received the error "Could not complete your request because Photoshop was unable to parse the PostScript. When I tried to open a PSD image file into Photoshop, I received the error "The documents Adobe Photoshop data which appears to be damaged. Continue and ignore the Photoshop data?" When I tried to open a TIF image file into Photshop, I received the error "Could nnot complete your request because of a problem parsing the TIFF file."


              I find this extremely frustrating as this is the only "add-on" for MODx that I’m able to find that offers secure downloading with the flexibility that I need for our site. I can’t just simply give up and try another. I’ve been troubleshooting this for what seems like a month or more at this point. At the moment, for the links that are not working correctly, I am linking text directly to the URLs. I hate leaving this hole open on the site for people to directly link our documents, but there is nothing I can do until I find a resolution for this.

              Any further help would be very much appreciated.
              • Hm. I was hoping it would be something easy like weirdness in the filenames.

                I’m getting ready to implement this in a site I’m working on; I’ve never used it before. I’ll have to see what happens and what I can figure out as I work with it.
                  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
                  • 28893
                  • 2 Posts
                  Quote from: tinusoetlomm at Aug 24, 2009, 06:31 AM

                  In my case the PHx plugin does corrupt the downloads. When disabled the downloads (in my case pdf files) are downloaded correctly. Enabled renders them unreadable.

                  If someone can show me a workaround for this issue without having to disable te PHx plugin entirely would be very appreciated. Myan24?

                  thanks in advance

                  This is how mine looks like, disabling phx based on a template id using a simple if():

                  include_once $modx->config['rb_base_dir'] . "plugins/phx/phx.parser.class.inc.php";
                  $e = &$modx->Event;
                  $id = $modx->documentObject['template']; // getting the template id, I'd like to filter on templates
                  
                  $PHx = new PHxParser($phxdebug,$phxmaxpass);
                  switch($e->name) {
                  	case 'OnParseDocument':
                   if($id != 21) {                        // The actual filter. If it's not my download template, then go ahead.
                  		$PHx->OnParseDocument();
                  		break;
                                 }
                             }
                  



                  Took some time to work things out, but all is working now.
                    • 14779
                    • 256 Posts
                    Is there anyway to set this to only allow one download per IP address?
                    If not, how would I do that?
                      PM me to find out how you can get a FREE ipad 2!
                      • 12512
                      • 42 Posts
                      A very useful snippet, thank you for providing it. Also well coded.

                      A suggestion: Instead of using a separate TV for content-type, could we not simply use the MODx’ document content-type field for that purpose? This would reduce the number of custom TVs required.