文件上传 upload server


原文链接: 文件上传 upload server

tus/tusd: The official server implementation of the tus resumable upload protocol.

服务端

1.
go get github.com/tus/tusd

  1. 下载依赖
    git clone git@github.com:aws/aws-sdk-go.git $GOPATH/src/github.com/aws/aws-sdk-go
  2. 运行
    go run cmd/tusd/main.go

##
curl -X POST -I 'http://localhost:8080/files'

           -H 'Tus-Resumable: 1.0.0' \
           -H 'Upload-Length: 12345678'

1.
curl -i -X OPTIONS localhost:1080/files/

  ` HTTP/1.1 200 OK
    Tus-Extension: creation,creation-with-upload,termination
    Tus-Resumable: 1.0.0
    Tus-Version: 1.0.0
    X-Content-Type-Options: nosniff
    Date: Fri, 20 Jan 2017 10:10:31 GMT
    Content-Length: 0
    Content-Type: text/plain; charset=utf-8
  `
`