如何将zip文件上传到azure blob,然后在那里解压缩 [英] How to upload zip file to azure blob then unzip it there

查看:267
本文介绍了如何将zip文件上传到azure blob,然后在那里解压缩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多zip文件,其中将只有几个文件夹和50多个文件.如何将这些zip文件上传到azure blob,然后在那里解压缩.

I have lot of zip files, which will have few folders and 50+ files in it. How can I upload those zip files to azure blob then unzip it there.

将服务器中的文件解压缩,然后将其中的文件一一上传到天蓝色的blob,将是一个繁琐的过程.

Unzipping the file in server and uploading files in it one by one to azure blob will be a cumbersome process.

天青是否有任何简单的方法来实现这一目标,或者有任何解决方法?

Does azure has any easy way to achieve this or is there any workaround?

我正在用PHP实现此功能.

I'm implementing this in PHP.

推荐答案

简单的答案是Azure Blob存储不会为您解压缩.这是您需要自己做的事情.您的操作方式取决于您.

Simple answer is Azure Blob Storage will not do the unzipping for you. This is something you would need to do on your own. How you do it is up to you.

一种可能性是(如您提到的)您将zip文件上传到服务器上,在其中解压缩然后再上传单个文件.

One possibility is (like you mentioned) that you upload zip files on your server, unzip them there and then upload individual files.

如果您担心Web服务器上正在发生的处理,另一种可能性是通过后台进程进行解压缩.通过这种方法,您只需将zip文件上传到Blob存储中.然后,通过一些后台过程(可以是WebJob,功能,辅助角色或虚拟机),您将下载这些zip文件,解压缩它们,然后重新上传这些单独的文件.

Another possibility is to do this unzipping through a background process if you are concerned about the processing happening on the web server. In this approach, you will simply upload the zip files in blob storage. Then through some background process (could be WebJobs, Functions, Worker Roles, or Virtual Machines), you would download these zip files, unzip them and then re-upload these individual files.

要按需触发后台进程,一旦上传了zip文件,您只需在队列中写一条消息,告诉后台进程下载zip文件并开始解压缩进程.

To trigger the background process on demand, once the zip file is uploaded you could simply write a message in a queue telling background process to download the zip file and start unzipping process.

这篇关于如何将zip文件上传到azure blob,然后在那里解压缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆