Now, I know how to do this easily, but how can it be done securely?
ie:
take data from file/textarea/etc place it onto the server in a new file without opening up the inharent security holes associtated with fopen/fwrite