A Client of me had the follwing Problem:
He has a Webcam that Uploads Pictures to a FTP Folder.
Unfortunaly the Webcam does Upload each File seperatly (Webcam_Eglisauxxxxxx.jpg) xxxxx stands for a Timestamp from the Webcam. There is no Way to achive that the Webcam by herself just overrides the latest file :(
Now i Need a php script to check against new Files in this Directory and rename it to a given Name. (Webcam_Eglisau_Image.jpg)
I know that this Need the rename function but i have no Idea how i can search for a not know Name (the xxxxxx) in the File.
The .php File will be located in the same Dir as the Pictures...
Any Ideas?
I would like to run this script after with a Cron Job :)
Thanks
You can use
It gives you all Files Webcam_Eglisau * .jpg Then you can rename the one which is called xxxxxxx (the newest)
Update: