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.
Nevermind, I figured out how to rename the file, but there are quite a few other problems I've got here, which is beginning to make me mad here.
What I need is to be able to upload either a file from a website (http://www.domain.com/images/image.jpg) or from a hard disk (C:/images/image.jpg), and the problem here is that I only can do from hard disk.
Another problem I've got is that I don't know how to check if a certain file with a certain name already exists, and deleting it if it exists before I upload the new file with that same name in there.Reply
You cannot upload a file from a website directly. However, you can write a few lines of code to retrieve the picture from the website, and then process it with the class (look in the doc for how to process local files)
As for overwriting existing files, from version 0.27, simply set file_overwrite to true (If you use an older version, you also have to set file_auto_rename to false).Reply
^"However, you can write a few lines of code to retrieve the picture from the website, and then process it with the class (look in the doc for how to process local files)";
Problem is, I'm not sure how to accomplish that.Reply
What I need is to be able to upload either a file from a website (http://www.domain.com/images/image.jpg) or from a hard disk (C:/images/image.jpg), and the problem here is that I only can do from hard disk.
Another problem I've got is that I don't know how to check if a certain file with a certain name already exists, and deleting it if it exists before I upload the new file with that same name in there.
As for overwriting existing files, from version 0.27, simply set file_overwrite to true (If you use an older version, you also have to set file_auto_rename to false).
Problem is, I'm not sure how to accomplish that.