fileserver

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 16 Imported by: 0

README

fileserver —— “文件上传+文件浏览+文件下载”服务

  • 非常简单,容易上手
  • 基于HTTP协议, 同时支持浏览器和curl命令行
  • 特别适合办公室局域网环境下, 跨操作系统平台瞬时文件传输服务
  • 暂不支持批量上传/下载
1. fileserver命令

查看帮助

$./fileserver -h
 Usage of ./fileserver:
   -dir string
     	file server data dir (default "./")
   -port string
     	port number (default "9090")

运行服务

$ ./fileserver -port 9000 -dir ./test
Now serving on http://192.168.9.217:9000/
2. 命令行上传/下载

上传

$ curl -F uploadfile=@test.pdf http://127.0.0.1:9090/upload
test.pdf	上传完成, 文件路径:/home/chain/test/test.pdf

下载

$ curl -o test2.pdf http://127.0.0.1:9090/file/test.pdf
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  153M  100  153M    0     0   965M      0 --:--:-- --:--:-- --:--:--  967M
3. 浏览器上传/下载

文件服务器首页 index

选择上传文件 upload1

可对上传文件重命名 upload2

上传成功 upload3

查看文件 file1

点击浏览器右键——“另存为” file2

选择保存目录 file3

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL