implemented various things

This commit is contained in:
2023-02-28 19:05:09 +01:00
parent 2a42cbb07a
commit 8e5f33c99b
12 changed files with 297 additions and 114 deletions

View File

@@ -44,7 +44,7 @@ func Runclient(c *cfg.Config, args []string) error {
client.SetUserAgent("upctl-" + cfg.VERSION)
url := c.Endpoint + ApiVersion + "/file/put"
url := c.Endpoint + ApiVersion + "/file/"
rq := client.R()
for _, file := range args {
@@ -92,7 +92,7 @@ func Runclient(c *cfg.Config, args []string) error {
resp, err := rq.
SetFormData(map[string]string{
"expire": "1d",
"expire": c.Expire,
}).
SetUploadCallbackWithInterval(func(info req.UploadInfo) {
fmt.Printf("\r%q uploaded %.2f%%", info.FileName, float64(info.UploadedSize)/float64(info.FileSize)*100.0)