We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2611
    • 394 Posts
    If you send something as an inline attachment (or any other form of attachment) you cannot have white space before or after the file since it will be included in the downloaded file which would make it corrupt...right?
      Follow me on twitter: @b03tz
      Follow SCHERP Ontwikkeling on twitter: @scherpontwikkel
      CodeMaster
      • 22303 MODX Staff
      • 10,725 Posts
      With binary Static Resources, MODx simply uses readfile() to direct the binary file contents to the browser and avoid loading the entire file contents into memory. The Template is ignored, so there should be no issue with whitespace there. However, if you have manually edited any PHP files and those have extra whitespace before or after the PHP tags, this could indeed corrupt the output of any binary file.
        • 21635
        • 81 Posts
        Quote from: OpenGeek at Jul 08, 2010, 11:41 AM

        Can you compare the headers on successful download of the file (i.e. direct access via web server) with those that are getting a 500 error as a static resource?

        can’t see the header of a file that throws the error 500, but my isp gave me a line from the errorlog:

        [Tue Jul 13 18:37:58 2010] [error] [client xx.xx.xxx.xx] malformed header from script. Bad header=inline: php-5.2.12, referer: http://domain.de/schmie
        de/revo/manager/?a=30&id=2


        where can i find out the pdf-encoding?
          • 22303 MODX Staff
          • 10,725 Posts
          Best way I know is to use HttpFox (a Firefox extension) to show you all of the request and response details.
            • 21635
            • 81 Posts
            i now used wireshark on mac, but i guess it shows the same thing...

            •• this is the working pdf, directly called via url



            •• and this is the static resource, called via the manager’s preview-button.



            don’t know if this is of any use to you...
              • 22303 MODX Staff
              • 10,725 Posts
              No, I need to compare the headers of the responses; you only put the response from the valid one and the request for the invalid one.
                • 18654
                • 191 Posts
                Quote from: OpenGeek at Jul 08, 2010, 11:41 AM

                I still can’t reproduce this. Can anyone else reproduce the problem? Does the PDF in question happen to be UTF-8 or is it a different encoding? Can you compare the headers on successful download of the file (i.e. direct access via web server) with those that are getting a 500 error as a static resource?
                I was having alot of problems with getting static resources to download in the past, but I just downloaded rev7150 on my localhost and everything is running great. I’m having no problems with getting static resources to download - even with Templates, TV’s and large file sizes. It was definitely important to add the [[*content]] tag to the template, which I hadn’t done in the past. I’m running Zend Server Community Edition with MySQL 5.1.45 and PHP 5.2.1 on Windows 7.

                I love that the manager is getting alot faster - even since RC2. Looking forward to GA!

                -matt

                p.s. Only thing I might add is that transport.core.php took alot longer than usual to run (112 seconds compared with 30-45 seconds normally) and the setup interface skipped the page where I enter database info and username. I had to click the back button to get that page to come up because it wasn’t finding my DB.
                  God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.
                  • 28215
                  • 4,149 Posts
                  Quote from: mattcdavis1 at Jul 13, 2010, 08:25 PM

                  p.s. Only thing I might add is that transport.core.php took alot longer than usual to run (112 seconds compared with 30-45 seconds normally) and the setup interface skipped the page where I enter database info and username. I had to click the back button to get that page to come up because it wasn’t finding my DB.
                  This was actually an oversight; in normal upgrades, you should never see that DB page. Only in advanced upgrades (selected on the options page) should you see the database and contexts pages.
                    shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                    • 21635
                    • 81 Posts
                    I was having alot of problems with getting static resources to download in the past, but I just downloaded rev7150 on my localhost and everything is running great.

                    thanks for the hint, i also did a quick install on my MAMP and everything worked as expected.

                    well, there i am now, it works locally, but does not on 2 different server setups. my isp-support just told me the script was canceled because of the error
                    malformed header from script. Bad header=inline
                      • 21635
                      • 81 Posts
                      well, i have something new now:

                      i tried the "import resources"-tool and imported 3pdfs i had copied into the core/import beforehand.

                      then, when i preview these, i at least don’t get the error 500, but the before-mentioned 0kb-pdf file. this is the header response:


                      what got me wondering: the batch-import process simply put the pdf-filename in the "static resource" field, without a path.
                      when i add the path to core/import/file.pdf i get error 500.

                      i played a bit with rb_base_dir setting. but it seems to continue like that:
                      as soon as i get the reference-path right (i can tell by the html-output displaying pdf content) i get the error 500.

                      still running rev7083