Have a set of files on FTP server in a folder. I need a script that:
- logins to ftp server
- copy a file from one folder to another
- the filename is received from the URL string in the fname parameter
- rename the copied file to some random 10-digit-string (alphanumeric) (e.g. from XYZ.rm to hgy5ubae30.rm)
- serve the file to the user
- before the script runs, the temp folder should be cleared out - if there are files currently opened, the error should be handled properly and continue with the rest of the script (eventually after this script is run several times, those undeleted files will be deleted)
The files are all named some_filename.rm, in the videos folder. They are served to the user as rtsp://mysite.com/tempvid/filename.rm - they should be copied to a folder called tempvid and served from there.
Thank you!