【问题标题】:Does Lasso 8.6 have a means of extracting an uploaded zip file to a specified path?Lasso 8.6 是否可以将上传的 zip 文件提取到指定路径?
【发布时间】:2013-09-30 17:43:08
【问题描述】:

我正在尝试提供一种允许人们上传 zip 并将它们提取到特定文件路径的方法。似乎在 Lasso 9 中添加了 zip 功能,但我很好奇 8.6 中是否确实有这样做的方法,或者是否有人有任何建议。

【问题讨论】:

    标签: lasso-lang


    【解决方案1】:

    有几个选项(除了升级到 9):

    1. 首先,您可以使用 [os_process] 调用 unzip 命令行实用程序并让它为您执行此操作

    2. 在 8.5 中,LJAPI 文档中有一个示例创建了一个您应该能够使用的 [zip] 自定义类型。 (我不确定 8.6 安装程序是否有它,但对于 OS X,安装 8.5 后,您可以在此处找到它:/Applications/Lasso Professional 8/Documentation/3 - Language Guide/Examples/LJAPI/Tags/ZipType/)语言指南的第 67 章包含有关如何安装和工作的文档。

    【讨论】:

      【解决方案2】:

      在 bfad 的回答中进一步阐述选项 1:您可能会喜欢 TagSwap 中的 Lasso 8 shell 标签,以使其更容易。这是我提取 tar'd 和 gzip'd 档案的示例:

      // authenticate with user that has file permissions in this directory
      inline(-username='username', -password='password');
      
          // load shell tag from TagSwap
          library_once('shell.inc');
      
          // call tar  from bash shell
          shell('tar -zxf myfile.tgz');
      
      /inline;
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-05-14
        • 2014-04-16
        • 2015-02-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多