Added S3 support for documents