I think this is the simplest code you’ll ever get. It is formed by one line. You just have to replace the target path to your need and you’re good to go.
I hope it will fit your need. If the item will be bought enough I’ll post the AS3 version.
Good luck and hope you’ll rated Thank you