mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-17 03:42:26 +08:00
fix: qiniu upload file
This commit is contained in:
3
qiniu.go
3
qiniu.go
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
@@ -48,7 +49,7 @@ func FileUpload(name string, size int64, data io.Reader) (string, error) {
|
|||||||
ret := new(storage.PutRet)
|
ret := new(storage.PutRet)
|
||||||
putExtra := &storage.PutExtra{}
|
putExtra := &storage.PutExtra{}
|
||||||
|
|
||||||
err := uploader.Put(nil, ret, upToken, key, data, size, putExtra)
|
err := uploader.Put(context.Background(), ret, upToken, key, data, size, putExtra)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user