We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4749
    • 623 Posts
    This is the error I’m getting when trying to upload pictures in a smoothgallery slideshow. It says, "Failed to open stream: Permission denied" What’s that all about?

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »
     
    PHP error debug
      Error: 	move_uploaded_file(assets/gallery/1/pic1.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied	 
      Error type/ Nr.: 	Warning - 2	 
      File: 	/home/hilleshe/public_html/in-sitedesigngroup.com/assets/snippets/maxigallery/maxigallery.php	 
      Line: 	413	 
      Line 413 source: 	move_uploaded_file( $_FILES['file'.$i]['tmp_name'] , $mg->path_to_gal.$name ); 	 
     
    Parser timing
      MySQL: 	0.0055 s	(2 Requests)
      PHP: 	0.0404 s	 
      Total: 	0.0459 s
    


    Thanks.

    Update: Now I’m getting this error:

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »
     
    PHP error debug
      Error: 	getimagesize(/home/hilleshe/public_html/in-sitedesigngroup.com/assets/gallery/1/111pic2.jpg) [function.getimagesize]: failed to open stream: Permission denied	 
      Error type/ Nr.: 	Warning - 2	 
      File: 	/home/hilleshe/public_html/in-sitedesigngroup.com/assets/snippets/maxigallery/maxigallery.php	 
      Line: 	1106	 
      Line 1106 source: 	$imagesize=getimagesize($modx->config['base_path'].$mg->path_to_gal.$pics[$i]['filename']); 	 
     
    Parser timing
      MySQL: 	0.0058 s	(3 Requests)
      PHP: 	0.0436 s	 
      Total: 	0.0494 s
    


    EDIT: There were several problems in this post that were related, yet different errors. All the issues I was having are now gone. I apologize for the sporadic and incoherent rants on this post. But, if you read through it you should be able to glean some useful information from Doze’s useful tips and suggestions. Good luck and happy modxing!
      The MODx has you...
      Utah Web Design
      • 7923
      • 4,213 Posts
      What version are you using? when these errors occur?


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 4749
        • 623 Posts
        Doze,
        You asked me to upgrade to the latest SVN. I’m running ModX 0.9.6 and the here’s the MG call:

        [!MaxiGallery? &display=`embedded` &embedtype=`smoothgallery` &galleryPictureTpl=`slideshowTpl` &smoothgallery_timed=`true` &smoothgallery_height=`250` &smoothgallery_width=`748` &smoothgallery_showInfopane=`false` &smoothgallery_fadeDuration=`800` &smoothgallery_embedLinks=`false` &smoothgallery_delay=`4500` &smoothgallery_preloader=`true` &smoothgallery_showCarousel=`false` !]
          The MODx has you...
          Utah Web Design
          • 4749
          • 623 Posts
          It seems as if every time I upload a picture it changes the permissions to the folder and the images. Weird too, it changes them to: 1304, 0204, weird permissions that I’ve never seen before. What’s going on?
            The MODx has you...
            Utah Web Design
            • 7923
            • 4,213 Posts
            No, the latest SVN code is not working and you should not use it with out modifying.. (all the chmod lines need to have hard coded values).

            If you need the latest code from SVN, you should use an older revision.. I have probably pointed you to some other rev?

            In any case, that’s the problem.


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 4749
              • 623 Posts
              Thanks, which rev should I be using?

              It seems that Modx/MaxiGallery is inserting some inline styles that I can’t control. There are some inline styles that are being printed in the <head></head> tags. I’ve never seen that before. It may be another idiot question, but I hope you know why. Here’s what it inserts:

              <style type="text/css">
              	#myGallery1
              	{
              	width: 748px;
              	height: 250px;
              	z-index:5;
              	display: none;
              	}
              </style>
              
                The MODx has you...
                Utah Web Design
                • 7923
                • 4,213 Posts
                Latest working code from SVN should be rev 137, but I haven’t tested it very thoroughly.. But I cannot remember why you need the code from SVN in first place..

                Those styles are for the smoothgallery display type. It layouts the container div of the smoothgallery to &smoothgallery_height and &smoothgallery_width what are the value of &max_pic_size by default.. it also makes the id using &smoothgallery_id parameter what is needed when you have multiple smoothgalleries on same page and you want them to be different.. the id is page id by default.


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 4749
                  • 623 Posts
                  OK, that explains something, but why is it inserting a display: none; into that css?

                  Here’s what’s showing the in the <head> tags:

                  <style type="text/css">
                  			#myGallery1
                  			{
                  			width: 0px;
                  			height: 0px;
                  			z-index:5;
                  			display: none;
                  			}
                  			</style>
                  <link rel="stylesheet" href="/assets/snippets/maxigallery/smoothgallery/css/jd.gallery.css" type="text/css" media="screen" />
                  	<script type="text/javascript" src="/assets/snippets/maxigallery/smoothgallery/js/mootools.js"></script>
                  	<script type="text/javascript" src="/assets/snippets/maxigallery/smoothgallery/js/jd.gallery.js"></script>
                  <link rel="stylesheet" href="/assets/snippets/maxigallery/css/default.css" type="text/css" media="screen" />
                  
                  			<style type="text/css">
                  			#myGallery1
                  			{
                  			width: 0px;
                  			height: 0px;
                  			z-index:5;
                  			display: none;
                  			}
                  			</style>
                  <link rel="stylesheet" href="/assets/snippets/maxigallery/smoothgallery/css/jd.gallery.css" type="text/css" media="screen" />
                  	<script type="text/javascript" src="/assets/snippets/maxigallery/smoothgallery/js/mootools.js"></script>
                  	<script type="text/javascript" src="/assets/snippets/maxigallery/smoothgallery/js/jd.gallery.js"></script>
                  <link rel="stylesheet" href="/assets/snippets/maxigallery/css/default.css" type="text/css" media="screen" />
                  


                  It’s doubled up for some reason.
                    The MODx has you...
                    Utah Web Design
                    • 7923
                    • 4,213 Posts
                    display:none because it’s made visible via the smoothgallery javascript and the js doubling is because of a bug that was in MODx 0.9.6. I suggest to update to 0.9.6.1 what fixes also lots of other things..


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 4749
                      • 623 Posts
                      Doze,
                      I went ahead and did the upgrade, but I still have doubled galleries. And some of my galleries don’t show a manager button. At least the upgrade went smoothly!
                        The MODx has you...
                        Utah Web Design