I'm working on a file upload script. I've got the script designed so that it will accept images with the following suffixes: .gif, .jpg, and .bmp.
I've got the script written so that it replaces the names of the image with a number. The first image that is uploaded has the number "1", the second image uploaded has the number "2", and so forth.
The script works fine if the user uses the image upload page just once. A problem might occur, though, if the user hit back button, returned to the file upload form, and uploaded more images.
If there is an image in the folder on the server named "1.gif" and if the additional image that the user uploads is a ".jpg" image then the image might be "1.jpg". In other words, both images would have the prefix "1" - but both images would have a different suffix. That may cause difficulties later on.
I think that I may already have a solution to the problem. What I can do is use one of the string functions and replace the ".gif" and ".bmp" suffixes with the ".jpg" suffix on each image. That way all of the images would have the same suffix.
As a test, I've manually changed the suffixes on all of the images in a folder to the ".jpg" suffix. The images seem to be working ok. However, I wonder if I might be overlooking something.
I know that the ".gif", ".jpg", and ".bmp" images are different. The file sizes are different in the folder.
Does anyone know any reason that changing the image suffixes to the ".jpg" suffix would cause any problems?
Thanks.
Volitics