class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
You set the parameter file_overwrite to true, but you also need to set file_auto_rename to false, otherwise it renames the picture by default. This is normal beahviour, since we want to avoid loosing images when simply using the default settings.
Well, the destination file is an image, so I'm limited as to what permissions that file can be set to. And, the directory is set to 777. I'm using version 0.20 that I grabbed off of phpclasses.org.
These files were originally uploaded to the directory using FTP. This scenerio works for some reason:
1. I delete the original FTPed image 2. I use your upload class to upload that image 3. I use your upload class to upload and overwrite the image in step #2.
I wonder why this would be different than just using your upload class to overwrite the FTPed image? I checked all of the images in the directory and they all have the same apparent permissions checked (0644). Both the images FTPed and the images uploaded using the class.
Unfortunately, the same error message appears. We are in the process of moving everything to a new web server as well, so this problem has a chance of disappearing at that point. Until then, I can just unlink/delete the original file before uploading the new one for now.Reply
Re: Problem during overwrite the existing image new!
I am not too sure here but i may have found a solution to your problem. I have been experiencing the same problem when i moved a domain over to another server for testing. I could add new images but not overwrite existing ones. This was with the same script used on the other domain.
After much testing the only way i could make it work was to chmod the images folder for the uploaded folder to 777 like before but also all the original files in it also. The with full permissions the overwrite feature works. Once the script has uploaded the image or overwritten it the permissions are set to 644 like before. I dont know what security risks are at threat if there are any but i will keep a note if this happens again.
In theory if all products were eventually updated on the server the file permission will eventually go back to 644.
I dont know if this has anything to do with what was mentioned about about the web server permissions but if this helps then great.Reply
So try:
Error: Destination directory can't be made writeable. Can't carry on a process
I have the following set:
It works great if I allow it to create a new filename and not overwrite the existing, but overwriting the existing file throws the error.
Any ideas on what may be causing this?
Jenifer
Are you using the version 0.20 or the 0.21RC?
These files were originally uploaded to the directory using FTP. This scenerio works for some reason:
1. I delete the original FTPed image
2. I use your upload class to upload that image
3. I use your upload class to upload and overwrite the image in step #2.
I wonder why this would be different than just using your upload class to overwrite the FTPed image? I checked all of the images in the directory and they all have the same apparent permissions checked (0644). Both the images FTPed and the images uploaded using the class.
Very odd...
Jenifer
Try version 0.21, there are more checks for the file permissions and overwriting.
After much testing the only way i could make it work was to chmod the images folder for the uploaded folder to 777 like before but also all the original files in it also. The with full permissions the overwrite feature works. Once the script has uploaded the image or overwritten it the permissions are set to 644 like before. I dont know what security risks are at threat if there are any but i will keep a note if this happens again.
In theory if all products were eventually updated on the server the file permission will eventually go back to 644.
I dont know if this has anything to do with what was mentioned about about the web server permissions but if this helps then great.