0

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 files must be deleted. How is this possible using server-side actionscript?

2 Answers 2

0

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...

3
  • The backend technology in case of my video recorder application in .Net and the server on which FMS is configured is not Windows. Jan 16, 2011 at 17:23
  • So doing this using .net is not possible. Jan 16, 2011 at 17:23
  • So i wanted a script in actionscript that runs by itself periodically on FMS or can be called from client-side actionscript and delete the recorded files on the server Jan 16, 2011 at 17:25
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.