有没有办法允许我的网站的用户通过 Flash/PHP/其他服务从 Amazon S3 下载大量图像文件?
我的网站允许用户上传我存储在 Amazon S3 上的照片。我存储原始上传以及优化的图像和缩略图。我希望允许用户在订阅到期时能够导出所有原始版本。所以我想出现以下问题
- 可能是大量数据(可能大约10GB)
- 如何管理下载过程 - 例如确保它是否被中断从哪里重新开始,如何验证文件的成功下载
- 应该是这样完成单个文件或尝试压缩文件并作为一个文件或一系列较小的压缩文件下载。
有没有我可以使用的工具?我见过 Fzip,它是一个用于处理 zip 文件的 Actionscript 库。我有一个正在运行的 EC2 实例来处理文件上传,因此也可以使用它来下载 - 例如,将文件从 S3 复制到 EC2,将它们压缩,然后通过 Flash 下载器将它们下载给用户,使用 Fzip 将 zip 文件夹解压缩到用户的硬盘驱动器。
有人遇到过类似的服务/解决方案吗?
感谢所有意见 谢谢
My website allows users to upload photographs which I store on Amazon's S3. I store the original upload as well as an optimized image and a thumbnail. I want to allow users to be able to export all of their original versions when their subscription expires. So I am thinking the following problems arise
- Could be a large volume of data (possibly around 10GB)
- How to manage the download process - eg make sure if it gets interrupted where to start from again, how to verify successful download of files
- Should this be done with individual files or try and zip the files and download as one file or a series of smaller zipped files.
Are there any tools out there that I can use for this? I have seen Fzip which is an Actionscript library for handling zip files. I have an EC2 instance running that handles file uploads so could use this for downloads also - eg copy files to EC2 from S3, Zip them then download them to user via Flash downloader, use Fzip to uncompress the zip folder to user's hard drive.
Has anyone come across a similar service / solution?
all input appreciated
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有直接处理过这个问题,但我最初的想法是:
可以利用 Flash 或可能的 jQuery 来实现自己开发的解决方案,让客户端发回有关其收到的信息并将该信息存储在数据库日志中。您还可以考虑使用 Bit Torrent 作为中介,您的用户可以下载免费的 torrent 客户端,并且您可以研究服务器端 torrent 服务(可能是 RivetTracker 或 PHPBTTracker)。我不确定这些内容有多详细,但至少,因为您确信您正在与单个用户打交道,如果他们成为播种者,您可以擦除旧文件并开始下一个文件。
将大于 2GB 的文件分成 2GB 的块,以适应使用无法处理的 FAT32 驱动器的用户〜4GB 文件。如果服务器上的空间有限,则分解为 1GB,并通过数据库记录对从 S3 压缩的内容保持基准
Fzip 对从 S3 压缩的内容保持基准很酷,但我认为它更适合客户端存档。 PHP 有 ZIP 和 RAR 库 (http://php.net/manual/en/book .zip.php)您可以使用服务器端对文件进行舍入。我认为您找到的任何解决方案都需要您自己管理安全性,方法是将记录保存在数据库中,记录谁拥有什么并下载密钥。不这样做可能会导致人们窃取您作为文件传输系统的资源。
祝你好运!
I have not dealt with this problem directly but my initial thoughts are:
Flash or possibly jQuery could be leveraged for a homegrown solution, having the client send back information on what it has received and storing that information in a database log. You might also consider using Bit Torrent as a mediator, your users could download a free torrent client and you could investigate a server-side torrent service (maybe RivetTracker or PHPBTTracker). I'm not sure how detailed these get, but at the very least, since you are assured you are dealing with a single user, if they become a seeder you can wipe the old file and begin on the next.
Break larger than 2GB files into 2GB chunks to accommodate users with FAT32 drives that can't handle > ~4GB files. Break down to 1GB if space on the server is limited, keeping a benchmark on what's been zipped from S3 via a database record
Fzip is cool but I think it's more for client side archiving. PHP has ZIP and RAR libraries (http://php.net/manual/en/book.zip.php) you can use to round up files server-side. I think any solution you find will require you to manage security on your own by keeping records in a database of who's got what and download keys. Not doing so may lead to people leeching your resources as a file delivery system.
Good luck!