zipstream

授权协议 MIT License
开发语言 JavaScript
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 富波光
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

zipstream

Crystal CI

A command line tool that allows you to easily share files and directories over the network

Installation

Precompiled executables are available for Linux and macOS from Releases page.

Snap-specific information

Due to the snap's confined nature, the application can only access files in the user's home directory.To access files under /media or /mnt directories you have to manually connect the snapto the removable-media interface by running the following command in a terminal

sudo snap connect zipstream:removable-media

Build from source

Clone the repository:

git clone https://github.com/mamantoha/zipstream.git

Switch to repo-directory

cd zipstream

Build:

shards build

Copy ./bin/zipstream to executable path.

Enjoy!

Usage

Help message:

NAME
    zipstream - is a command line tool that allows you to easily share files and directories over the network

VERSION
    0.18.3

SYNOPSIS
    zipstream PATH [options]

If PATH is not specified it point to current directory

OPTIONS
    -h, --help                       give this help list
    -l, --log                        logging of requests/responses
    -w, --web                        run WEB Server with the directory listing
    -H HOST, --host=HOST             the host (default: `0.0.0.0`)
    -p PORT, --port=PORT             the port (default: `8090`)
    -f FORMAT, --format=FORMAT       the format of output archive, zip, tar or tgz. Only for CLI mode. (default: `zip`)
    -o FILENAME, --output=FILENAME   the output file name without extension. Only for CLI mode. (default: `download`)
    -e PATH, --endpoint=PATH         the URL path to the resource. Only for CLI mode. (default: ``)
    -j, --junk-parent                stream the content of an archive without including the parent directory
    -h, --hidden                     match hidden files and folders
    --user=user                      the username user for file retrieval
    --password=password              the password password for file retrieval
    -V, --version                    print program version

Sharing a directory as tar archive:

$ zipstream -f tar /media/disk/music --user=admin --password=passwd -o music -e dl
     _           _
    (_)         | |
 _____ _ __  ___| |_ _ __ ___  __ _ _ __ ___
|_  / | '_ \/ __| __| '__/ _ \/ _` | '_ ` _ \
 / /| | |_) \__ \ |_| | |  __/ (_| | | | | | |
/___|_| .__/|___/\__|_|  \___|\__,_|_| |_| |_|
      | |
      |_|

Serving `/media/disk/music` as `music.tar`

To download the file please use one of the commands below:

wget --content-disposition --user admin --password passwd http://0.0.0.0:8090/dl
curl -OJ --user admin:passwd http://0.0.0.0:8090/dl

Or place all files into current folder:

wget -O- --user admin --password passwd http://0.0.0.0:8090/dl | tar -xvf -
curl --user admin:passwd http://0.0.0.0:8090/dl | tar -xvf -

Or just open in browser: http://0.0.0.0:8090/dl

Run an ad hoc http static server in specified directory, available at http://localhost:8090:

zipstream /media/disk/crystal --web

Image of browser

Contributing

  1. Fork it (https://github.com/mamantoha/zipstream/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • ZipInputStream: ZipInputStream(InputStream in) :创建新的 ZIP 输入流。 int read(byte[] b, int off, int len) :从当前 ZIP 条目读入字节数组。 long skip(long n) :跳过当前 ZIP 条目中指定的字节数。 int available()

  • 将图片或文档按要求打包并下载一个用于PHP的快速简单的流式压缩文件下载器。使用这个库可以省去将Zip文件写入磁盘的麻烦。你可以直接发送给用户,这要快得多。它可以与S3桶或任何PSR7流一起工作。 安装composer require maennchen/zipstream-php 打包并下载(官方例子)// Autoload the dependencies require 'vendor/aut

  • ZipArchive php自带的类库,无需安装 官方文档:https://www.php.net/manual/en/class.ziparchive.php 前端代码 <button id="download_imgs">导出学生图片资源 </button> <script>

  • 1、安装 zipstream pip install zipstream 2、简单封装下zipstream # -*- coding: UTF-8 -*- import zipfile import os import zipstream class ZipUtilities: zip_file = None def __init__(self): self.z

  • 根据我的经验,最好的解决方案是使用aws-sdk-php通过启用了registerStreamWrapper()的s3client访问S3上的对象。然后使用fopen从S3流式传输对象并将该流直接提供给ZipStream的addFileFromStream()函数,并让ZipStream从那里获取它。没有ZipArchive,没有大量内存开销,没有在服务器上创建zip或从Web服务器上的S3复制文

  • 我有一个 PHP网站有很多媒体文件,用户需要能够一次下载多个文件作为.zip.我试图使用 ZipStream在“存储”压缩的情况下随时为拉链提供服务,因此我实际上不必在服务器上创建一个zip,因为一些文件是巨大的,压缩它们的速度太慢了. 这是非常好的结果文件可以打开每个zip程序,我尝试没有错误,除了OS X的默认解压缩程序,存档实用程序.您双击.zip文件,并且Archive Utility决定

相关阅读

相关文章

相关问答

相关文档