I have to ftp different named ".jpg" files to a directory on my server from one of two LAN IP cameras. I have no control over the file name on the second camera other than I can set a prefix, which I use "webcam2-" and the camera adds the "date and time.jpg". Such as "20140303_103914_0.jpg". My JS script uses a single file name to refresh the image every 30 seconds, "webcam1.jpg" and "webcam2.jpg" respectively. The first camera is able to ftp and overwrite the image file "webcam1.jpg", but the second camera just keeps adding the different named files to the directory. I need the uploaded file from the second camera to be renamed to "webcam2.jpg". I am not sure of the best approach to resolving this.

Is there an easy server side solution? Or is a best approach to try to make the JS script cycle thru the file names and delete files and rename? I don't have access to cron.

I can't change the file name of the file prior to upload and I just need the most current uploaded image to be named "webcam2.jpg".

Thanks for any advise or help.

Wes