Deleting recorded files from a directory in Flash media interactive server using server-side script
How can i delete files from a directory inside flash media interactive server using server-side actionscript?
The sript should check if the size of the directory is greater than 1 GB. If yes older f开发者_C百科iles must be deleted. How is this possible using server-side actionscript?
Why do you want to do this with actionscript? You can just use Python to poll the directory size and delete the oldest files when it reaches your threshold. Or, if it makes more sense, you can use some interface to inotify to tell you about filesystem changes (you can make it so it tells you whenever a file is closed for reading, for instance) and make a file deleter script:
https://github.com/rvoicilas/inotify-tools/wiki/#info
You can do this on UNIX-like systems. If you're using Windows, good luck...
I know this is an old thread, but there didn't seem to be much information out there for this useful routine for those stuck with shared hosting on providers like Influxis. Their file management is a bear.
Create a flash client that connects to the server then use the File Class to list the contents of the directory, order it by creation time, then delete the oldest x% of the files.
精彩评论