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.
The form is submitted and the images need to be resized & renamed to image_1.JPG => image_5.JPG and need to overwrite the existing 5 images in the destination directory... (which are also named image_1.JPG => image_5.JPG )
I need the images to follow this naming convention: image_1.JPG | image_2.JPG | image_3.JPG | image_4.JPG | image_5.JPG
If i set the $handle->file_new_name_body = 'image'; the first image is called image.jpg then, the second image is image_1.jpg and so on...
Can someone please advise how I might be able to do this?
For instance:
the resulting images are:
image_5.JPG
image_5_1.JPG
image_5_2.JPG
image_5_3.JPG
image_5_4.JPG
The five images are passed from a form as an array to upload.php.
The form is submitted and the images need to be resized & renamed to image_1.JPG => image_5.JPG and need to overwrite the existing 5 images in the destination directory... (which are also named image_1.JPG => image_5.JPG )
Hope this clarifies what i'm trying to achieve.
Thanks in advance!
I defined a variable:
then modified the handle:
and made sure the following two handles were set:
Hopefully this will help someone out there trying to do the same.
Thanks again for a fantastic class!
Glad you like the class :)