We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    Quote from: romyaspe at Nov 13, 2006, 12:02 AM

    the skingraft has been installed thru resource wizard.

    however, i do not see it the way the screenshot shows what skingraft should look like.

    i don’t see the preview.

    and the worst part is, i could not install sg.zip files with skingraft.

    how do i correct this?
    I have no idea. It might be that something is wrong with the installation?
      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
      All of the above... in no specific order.


      I send pointless little messages
      • 7370
      • 8 Posts
      I did the same for Skingraft

      /*if ($ttype !== "application/zip") {
      $dec_arr = array(’upload’=>$_sgl[’back_b’]);
      $declare = "<h2>".$_sgl[’exam_zip’]."</h2>";
      $declare .= $this->sg_foot($dec_arr);
      unlink($uf);
      return $declare;
      }*/

      that’s also working now ..
      Maybe i have to setup mime differently on my webhost ?
        • 22815
        • 1,097 Posts
        Quote from: diggidis at Nov 13, 2006, 04:15 AM

        Maybe i have to setup mime differently on my webhost ?

        Either your webhost or your web browser has it "wrong", but it’s a common wrong, and seemingly Windows related (although it dates back to Netscape).

        Elsewhere, it has been solved:
        Quote from: Gildas at Nov 13, 2006, 02:37 PM

        On WAMP5 I have to change the test from "application/zip" to "application/x-zip-compressed". With this correction, all work fine wink

        Some quick research shows that the only two MIME types for zip are the two in that quote, so the best thing to do is for MODx Resource Wizard to be changed - the if ($ttype !== "application/zip") bit needs to accommodate application/x-zip-compressed as well. This would seemingly reduce the number of people having problems.
          No, I don&#39;t know what OpenGeek&#39;s saying half the time either.
          MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
          Forum: Where to post threads about add-ons | Forum Rules
          Like MODx? donate (and/or share your resources)
          Like me? See my Amazon wishlist
          MODx "Most Promising CMS" - so appropriate!
          • 7370
          • 8 Posts
          Awesome stuff man ! laugh

          Yeah I use Windows rolleyes

          But Mozilla browser .. hehe
            • 14050
            • 788 Posts
            According to php.net, it has this to say about the contents of the $_FILES array:

            $_FILES[’userfile’][’type’]

            The mime type of the file, if the browser provided this information. An example would be "image/gif". This mime type is however not checked on the PHP side and therefore don’t take its value for granted.

            As such, I think a possible solution would be to change the code to this in the MODx Reseource Wizard, of course this would also apply to SkinGraft:

            		//  <-- Error if the package is not uploaded as 'application/zip'. -->
            		$this->resource_pkgfile = $_FILES['userfile']['name'];
            
            		if (!(strpos($this->resource_pkgfile,'zip',strlen($this->resource_pkgfile)-3))) {
            			$this->evalErrArray = array(''=>$main_button);
            			$this->evalErr = "<h2>$not_valid</h2>\n";
            			echo $this->resource_pkgfile.'<BR>';
            			echo strpos($this->resource_pkgfile, '.zip');
            			$this->evalErr .= $this->wizard_buildForm();
            			$this->evalErr .= $this->wizard_getFoot($this->evalErrArray);
            			unlink($this->eval_path.$this->resource_pkgfile) or die('Could not remove upload from '.$this->eval_path.$this->resource_pkgfile);
            			return $this->evalErr;
            		}


            Now as long as the file ends in .zip, it will allow the file to go through to the other checks. The strange thing is that I was having the error with the MRW, until I commented it out, but I didn’t have the problems with SkinGraft. And even more weird is that the problem went away when I uncommented his code after I was able to install my first resource package. All throughout I was using the same browser, so I thought this was interesting.
              Jesse R.
              Consider trying something new and extraordinary.
              Illinois Wine

              Have you considered donating to MODx lately?
              Donate now. Every contribution helps.
              • 26435
              • 1,193 Posts
              basically, the only reason that this check is in there is not to verify that the file is ACTUALLY A CORRECTLY FORMATTED ZIP ARCHIVE, it is because if the catch isn’t there, and you upload a jpg or txt file, the pclzip.lib.php class will spit out an ugly error with no "go back" or "do over" options. this catch is to allow a clean error messge to pop up without killing the application, thus allowing the user to click th "back to upload form" button and try a different file.

              Thanks for the research Paul. I will add a "||" or statement to the if it’s not a zip function.

              -sD-
                Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                All of the above... in no specific order.


                I send pointless little messages
                • 14050
                • 788 Posts
                I understand that this check is here just to nicely get out of the application. And as such, I think the best check would be my method has it only checks that it is a ’.zip’ file and not a ’.jpg’ or ’.etc.’ The only thing that concerns me with Paul’s code is the php.net description that says this:

                The mime type of the file, if the browser provided this information.

                So, and I am not sure what browsers would do this, if the browser doesn’t include any information at all about the mime type, then it would still toss an error, even if they uploaded a .zip file.
                  Jesse R.
                  Consider trying something new and extraordinary.
                  Illinois Wine

                  Have you considered donating to MODx lately?
                  Donate now. Every contribution helps.
                  • 26435
                  • 1,193 Posts
                  I totally agree with you jesster.
                  I have some interface and other upgrades coming this week, and I plan on putting your code into the module. great work! Thanks for taking the time to sift through this code. It could benefit from a bit of cleanup, so for you to filter through it and come up with a solution is awesome... and awesomely appreciated.

                  -sD-
                    Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                    All of the above... in no specific order.


                    I send pointless little messages
                    • 26435
                    • 1,193 Posts
                    Quote from: jesster444 at Nov 13, 2006, 05:42 PM

                    [...] And even more weird is that the problem went away when I uncommented his code after I was able to install my first resource package. All throughout I was using the same browser, so I thought this was interesting.

                    I wonder if it was something with the browser cache. I had sooooo many troubles when developing this module that miraculously disappeared when I cleared FF’s cache. hmmm? weird.

                    -sD-
                      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                      All of the above... in no specific order.


                      I send pointless little messages
                      • 26435
                      • 1,193 Posts
                      Jesster!!!
                      I just applied your patch to my source code with the latest revisions, and it works LIKE A CHARM!!!

                      The only thing it needs to do is check that the last 3 letters are z-i-p and I think you found the simplest way to do that. thank you for being pro-active. this is so much more refreshing than reading "mine don’t work. why?"

                      Thanks again man. your code has been committed to the next revision (out probably thursday? just a guess, maybe sooner).

                      later

                      -sD-
                        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                        All of the above... in no specific order.


                        I send pointless little messages