使用PHP在Google Drive上解压缩文件

使用PHP在Google Drive上解压缩文件,php,google-drive-api,unzip,Php,Google Drive Api,Unzip,我正在开发一个web应用程序,用户可以上传.zip文件并将其存储在谷歌硬盘中。上传部分很简单,但我不知道如何解压缩上传的文件 我找到了,但它是用Javascript编写的,我仍在试图找到如何使用PHP解压文件。有人知道如何做到这一点吗?我想您可以使用,即: 并没有找到解决方案,我认为现在不可能使用PHP解压驱动器上的文件。因此,我没有上传.zip,而是将zip解压缩到temp文件夹,然后循环读取文件。以下是我执行的步骤: loop items in folderId as item

我正在开发一个web应用程序,用户可以上传.zip文件并将其存储在谷歌硬盘中。上传部分很简单,但我不知道如何解压缩上传的文件

我找到了,但它是用Javascript编写的,我仍在试图找到如何使用PHP解压文件。有人知道如何做到这一点吗?

我想您可以使用,即:


并没有找到解决方案,我认为现在不可能使用PHP解压驱动器上的文件。因此,我没有上传.zip,而是将zip解压缩到temp文件夹,然后循环读取文件。以下是我执行的步骤:

    loop items in folderId as item
        if item == folder
            create folder on Drive
            fetch folder id as folderId
            loop(folderId)
        else if item == file
            file.parent = folderId
            upload file
        endif
    endloop

谢谢你的回复。我认为我们不能使用$zip->extractTo('/extract/path/');将文件解压缩到驱动器,或者我们可以吗?因为从文档中读取,我们应该使用Google_DriveFile类来上传文件。
    loop items in folderId as item
        if item == folder
            create folder on Drive
            fetch folder id as folderId
            loop(folderId)
        else if item == file
            file.parent = folderId
            upload file
        endif
    endloop