How to save parallely to a local storage and on the server?

And if I think of this closely it would be useful to either have a mechanism encrypting the upload automatically or a way to secure it via httacces on the server or anything alike. Any ideas?