added features from newer s3 direct upload version, including callback