上传ZIP文件到S3,使用EC2解压

Uploading ZIP file to S3, use EC2 to Unzip(上传ZIP文件到S3,使用EC2解压)
本文介绍了上传ZIP文件到S3,使用EC2解压的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有一个 Codeigniter 网络应用程序,它每小时向 Amazon S3 上传许多小文件,这导致我的 S3 请求费用非常快.解决此问题的一种方法是压缩文件,将 zip 文件上传到 S3,然后在 S3 上解压缩.

I have a Codeigniter web app that is uploading many tiny files every hour to Amazon S3, which is causing my S3 request charges to shoot up real fast. One way to overcome this will be to zip up the file, upload the zip file to S3, then unzip it when it is on S3.

这可以使用 EC2 完成吗?或者有没有更好的方法来实现这一目标?谢谢!!

Can this be done using EC2? Or is there a better method to achieve this? Thank you!!

如果我要使用 EC2,我是否使用 PHP 来触发 EC2 实例的创建,上传解压缩压缩文件所需的 PHP 文件,将解压缩的文件复制到 S3,然后销毁 EC2 实例?

If I were to use EC2, do I use PHP to trigger the creation of a EC2 instance, upload the PHP file required to unzip the zipped files, copy the uncompressed files to S3, then destroy the EC2 instance?

推荐答案

如果您在同一地区有一台 EC2 机器,我建议您将它上传到压缩包中,然后从那里解压到 s3.S3 无法自行解压缩,因为它完全是静态的.

If you have an EC2 machine in the same region I would suggest you upload it there zipped and then it drop it to s3 from there unzipped. S3 cannot unzip it on its own as its all static.

ec2 和 s3 之间没有任何费用,因此 ec2 可以处理解压缩,然后将其写入您的 s3 存储桶,而无需额外的传输费用.

Theres no charges between ec2 and s3 so ec2 can handle the unzipping and then write it out into your s3 bucket without additional transfer charges.

这篇关于上传ZIP文件到S3,使用EC2解压的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)