View Full Version : Error uploading images that breplace deleted ones
March 10th, 2010, 03:28 AM
I was doing some bulk uploads this evening and all of the new images uploaded fine but those which replaced images that had previously been in the same directory failed to upload.
The error is the usual cannot create stream but I note that the file names are being changed from xx_01.jpg to xx_010.jpg in the upload process. Even when I upload a single image it appends the extra zero to the file name which suggests to me that the index still believes there is an image of that name in that category.
Is there a way to rebuild the index or some other solution?
March 10th, 2010, 05:57 AM
It is suppose to rename the photo so it does not overwrite one that already exists. Only if an image with the same name is found would it be renamed.
I would need the exact error to post more.
March 10th, 2010, 06:16 AM
Here is the error -
Warning: copy(/home/user/10/204_01p011.jpg) [function.copy]: failed to open stream: No such file or directory in /photos/bulkupload.php on line 215
Warning: getimagesize(/var/www/html/photos/data/2700/204_01p011.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /photos/image-inc.php on line 264
Warning: Division by zero in /photos/image-inc.php on line 311
The actual file name was 204_01p01.jpg
March 10th, 2010, 07:25 AM
Check your uploads directory in global options the server path should read this
Your path appears wrong or if doing bulk uploads and entering a different path on upload make sure that path and all files are 777 permissions.
March 10th, 2010, 04:46 PM
The path to the uploads directory is /var/www/html/photos/uploads but the permissions to the directory I was uploading from (/home/user) were 755 so I have changed them.
After changing that one set of photos bulk uploaded ok but the names of them all had a 1 appended (i.e file011 instead of file01).
Interestingly (and I don't know if it is related) the default upload directory when I start a bulk upload is /var/www/htm/photos/uploads/3 which I overwrite with my own of course.
I started a second upload but used the approval process before uploading them and they all had the extra digit appended too so I abandoned the upload.
All of those files were replacing ones that had been deleted via the bulk actions tool.
To test whether the fact that they had been deleted has any bearing I created a new sub category and bulk uploaded a dozen photos to it from the same upload path - these images didn't have anything appended to their names so I am still thinking there is something going on with the index??
March 10th, 2010, 05:06 PM
Russ as stated if a filename with the same name already exists in the gallery as a filename being uploaded then the file is renamed.
March 10th, 2010, 05:20 PM
I can confirm that there are no images in that gallery with the same name and I have checked the actual folder (2937) that they are stored in.
However, there would be other images with the same name across the entire gallery as we use a standard naming convention for a particular category of images.
We have a number of manuals that contain the same categories (eg Section 100) and within each of these there will be a file named something like 100_01p01 (which represents section 100-01 page 01).
We probably have 70 categories set up like this and it hadn't been an issue prior to the recent upgrade (from 5.02 to 6.1) but I gather from what you are saying that is it now??
March 10th, 2010, 05:36 PM
Russ as stated it doesnt matter what category they are in as you can move photos. If a photo is found with the same name in the gallery database then the photo is renamed so there is no conflict should one move it. This is by design. You can not have photos with the same name in the gallery.
March 10th, 2010, 05:44 PM
Thanks Chuck -
I had confirmed that by uploading a couple of them with an appendix so that the names were unique. It certainly wasn't that way in 5.02 but as you said it clearly is now. This is going to force a bit of a rethink about image naming conventions as we had been getting away with the structure outlined above.
There would currently be 30 or so categories where that same naming convention has been used multiple times so I guess from here on in we will be appending the actual model to the end of the file name.
Thanks for the assistance.
March 10th, 2010, 05:51 PM
Russell yes it probally wasn't that way in 5.02 but that was indeed a bug that was fixed ;) You see people do move images to different categories etc etc. Thus the names have to be unique.
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.