Here is a useful servlet following best practices to take a file from a client application and write it to the JCR. We follow best practices using the LoginService. Also, do not forget to set the Apache Sling User Mapper service to the appropriate user (for testing on a local instance, use admin). I...