Hi,
With my feeble knowledge of php I have written a script for uploading and downloading image files. These upload to a given directory and rename the file as a codenumber attached to a patient record on the database.
My problem is that I don't know the file extension of the image file in the directory as users can upload them in various formats (bmp, jpg, jpeg, png, gif).
Is there a way of sending php header info to the user by filename only (without ext)? Or to verify the ext of the file found in a given directory before sending?
Any advice or pointers would be much appreciated.
Thanks,
K
P.S. These filenames will never be duplicated in other formats (e.g. scan.gif & scan.jpg). So only 1 file will ever be found.
With my feeble knowledge of php I have written a script for uploading and downloading image files. These upload to a given directory and rename the file as a codenumber attached to a patient record on the database.
My problem is that I don't know the file extension of the image file in the directory as users can upload them in various formats (bmp, jpg, jpeg, png, gif).
Is there a way of sending php header info to the user by filename only (without ext)? Or to verify the ext of the file found in a given directory before sending?
Any advice or pointers would be much appreciated.
Thanks,
K
P.S. These filenames will never be duplicated in other formats (e.g. scan.gif & scan.jpg). So only 1 file will ever be found.