Menu

Failed to copy problem needs solution

Help
2002-06-28
2002-10-26
  • Chris Holderness

    The gallery module is excellent! The amount of effort really shows - well done!

    It will be used by many more people if a solution to the basedir problem can be found.

    There was mention of a fix using a move function instead. Are there more details around the changes required?  I would love to be able to use this gallery on several sites...

    If you could put me on the path to a solution, I would appreciate it.

    Thanks

    Chris
    Chris@gerrisinc.com

     
    • Andrew Fisher

      Andrew Fisher - 2002-06-29

      Thanks to whoever mentioned the fix to this problem first! An updated gallery version will be released sometime soon with this solved once and for all.

      Anyway, what you'll want to do, Chris, is search for "@copy" (without the quotes) throughout index.php and gallery_functions.php and replace it with "@move_uploaded_file" (without the quotes). A quick and easy way would be to run a mass search and replace found in most text editors.

       
    • Chris Holderness

      Thanks Andrew. I had actually tried this, but ran into caching problems with our firewall. It actually worked fine.

      Unfortunately, I have two other problems that I'd like to ask about.

      First, I successfully added an image and thumbnail to an album. The thumbnail displays - and clicking on it brings up the display page - but the image is not there. Upon viewing source, the img path looks correct. It's either not displaying for some reason - or the relative path has a problem.

      The other is around the auto thumbnail generation. I have GD lib 1.6.2 installed and enabled. I get a thumbnail but its zero bytes.

      I'm getting closer and hope to use Gallery on several tourist sites.

      Your assistance is apprecuated. Thanks.

      Chris 

       
    • Chris Holderness

      If it helps, you can see what I mean at www.gerrisinc.com/phpwebsite
      If you go into the gallery, then into the first album (mickey) and click on the right hand thumbnail, you won't see the full image. If you type the full URL into the browser (that the relative img path is based on, if you do a view source) you will see the image. It's www.gerrisinc.com/phpwebsite/mod/gallery/media/10.jpg
      So it's there - maybe a relative path problem?

       
    • Chris Holderness

      The image is getting to the page, but the width and height are 0 - voila, no image displayed.

      Do you have any suggestions before I delve into the code? Do you use GD lib functions for this - remember that I have a problem with the auto thumbnails coming out at 0 bytes. Could be related?

      Chris

       
    • Chris Holderness

      This may be related to my thumbmail problem as well..
      In index.php, you have a bit of code to obtain the image width and height before storing it's info.
      The line is:  $image_wh = getimagesize($image);
      It seems that $image at this point is not valid. This may also be the thumbnail problem if the gd library is trying to resize/convert $image. I didn't get a chance to look at the upload function and see what's being returned. Rememeber alos that I'm the guy using "move" instead of "copy" because of the basedir problem.

      For now, I just removed the width and height from the html line being output. Doing that and manually supplying thumbnails is working for now - but I'd like to get this all operational - it's such and excellent module!

      Chris

       
      • Andrew Fisher

        Andrew Fisher - 2002-06-30

        Because of your PHP configuration having the open_basedir problem, I think you made me aware of some problems in the code. Therefore, I'm going to try and fix the code within the next couple days. Once it's done I'll e-mail you the updated script and perhaps you can test it out for me? Does that sound fine?

         
    • Chris Holderness

      I appreciate you working this - and I'll definitely assist your testing effort. I actually have one of my testers with spare time next week - perfect!

      Thanks again
      Chris
      chris@gerrisinc.com

       
      • Andrew Fisher

        Andrew Fisher - 2002-07-04

        On Monday of this week I looked at the add media code and figured out that the image needs to be moved first to the media directory then the image size needs to be determined. The problem is that if the image size is invalid the image would then have to be removed from the media directory and the db row deleted. As you can see, this is a big mess to avoid the open_basedir restriction. As a result, I'm going to put off writing a fix for this. I will make sure, however, that this issue is fixed for 1.4 which will include a whole rewrite of the code and take advantage of several of the core features of phpWebSite 0.9.x. Until then, someone may choose to fix this, but I'm not due to other circumstances.

         
    • Anonymous

      Anonymous - 2002-10-21

      Andrew,

      I'm having problems with the open_basedir errors. I've done the replace @copy suggestion and still get the messages. Could you please send me the updated scripts for the gallery? I'm hanging out to get this working...

      Cheers,

      Mike

       
      • Andrew Fisher

        Andrew Fisher - 2002-10-26

        Mike, unfortunately, there are no updated core scripts.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.