|Posted: Wed, 2005-07-27 06:08|
I installed Gallery 1.4.4-pl6 and tried to add photos to my first album. It failed to add the photos: details are below. (I hope the verbosity below helps rather than hinders your diagnosis!)
I tried adding photos through the "Form" interface. After specifying the path to the photo in the file box, I submitted the form. The photo was not added to the album, and I got the following error output (with debug mode on):
Resizing/compressing original image
The file /home/www/htdocs/photo/gallery/albums/album01/DCP_1035.jpg does not exist ?!
I have tried using the Gallery Remote applets with the same result. However, the URL method of uploading photos works fine.
I then tried poking through the code to see if I could determine more details about the source of the error. The error output above seems to happen because in util.php line 2170, the $file parameter to the move_uploaded_file() function is null. (This means the galleryXXXXX file created in /tmp is empty (file size of 0), and so no image is eventually copied to the albums directory.)
I traced back to find out why $file is blank. $file (in this case) seems to be assigned its value in save_photos.php line 293. ( $file = array_shift($userfile); )
Then I tried to figure out where $userfile is assigned. From what I can deduce, the variable is from includes/add_photos/add_form.inc line 92: it is a post parameter that contains the file path and name as entered in on the Add Photos (form method) page. If this is the case, why is $userfile blank when we perform an array_shift() on it in save_photos.php?
Or is there a simpler explanation for why I can't add photos?
(I have tried this with both large and small photos (icons), and so I don't belive I'm running into a problem with a maximum upload files.)
I then tried installing Gallery 1.5.1-RC1, but got the same error output. This leads me to believe that it's almost certainly a problem with my system setup. Any ideas?
(The files and line numbers above refer to the 1.4.4-pl6 release.)