简体   繁体   English

使用 API 网关直接从 S3 下载 zip 文件

[英]Download zip file from S3 using API Gateway directly

Is it possible to download Zip file present in S3 using API Gateway alone.是否可以单独使用 API 网关下载 S3 中存在的 Zip 文件。

Configurations:配置:

Integration type: AWS Service (S3)集成类型:AWS 服务 (S3)

endpoint: GET端点:GET

Content-Type: application/zip (or) application/octet-stream内容类型:application/zip(或)application/octet-stream

A corrupted zip file is getting downloaded.正在下载损坏的 zip 文件。

I could able to do a workaround using S3 presigned url and don't want to make the bucket public.我可以使用S3 预签名 url来解决问题,并且不想公开存储桶。

The file can get corrupted when some headers are missing from the upload PUT request.当上传 PUT 请求中缺少某些标头时,文件可能会损坏。 Please make sure the file is not-corrupted by downloading it manually and checking.请通过手动下载并检查文件来确保文件没有损坏。 If it's corrupted from the GET request only please make sure you include all the needed headers in the GET request too.如果它仅从 GET 请求中损坏,请确保在 GET 请求中也包含所有需要的标头。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM