URL 通过 S3 预签名上传文件的过期说明 URL

URL expiration clarification for uploading file through S3 pre-singed URL

假设我们生成一个预签名的 URL 来上传一个过期时间为 15 秒的文件。然后我们开始上传一个大文件。文件上传是否应在 URL 生成后的 15 秒内完成,或者如果文件上传在 15 秒内开始,则可以超过此时间?

上传操作应在到期时间之前开始,并且在开始后完成上传所需的时间没有已知限制。由于 S3 服务在开始上传操作时评估上传文件的权限,因此它不应受到实际上传文件所用时间的影响。

在您的情况下,考虑到文件大小,如果上传因任何原因失败,则用户将无法在 15 秒后重试。

以下是“Uploading using Pre-signed urls”文档

中有关这一点的更多详细信息

That is, you must start the action before the expiration date and time. If the action consists of multiple steps, such as a multipart upload, all steps must be started before the expiration, otherwise you will receive an error when Amazon S3 attempts to start a step with an expired URL. ```