aboutsummaryrefslogtreecommitdiffstats
path: root/cli/cli.go
diff options
context:
space:
mode:
authorPetter Rasmussen2015-02-23 22:53:40 +0100
committerPetter Rasmussen2015-02-23 22:53:40 +0100
commit8002119ffb5f5ce549c0b82959c59d685e45fb99 (patch)
tree5b77be2e50a15f51cf0eb360873c6878cfe69026 /cli/cli.go
parenta6e12715812da5103915c56d09f2ed9c4b7af1a7 (diff)
downloadgdrive-8002119ffb5f5ce549c0b82959c59d685e45fb99.tar.bz2
Use resumable upload
Diffstat (limited to 'cli/cli.go')
-rw-r--r--cli/cli.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/cli.go b/cli/cli.go
index 70e9942..adc50d7 100644
--- a/cli/cli.go
+++ b/cli/cli.go
@@ -5,6 +5,7 @@ import (
"github.com/prasmussen/gdrive/gdrive"
"github.com/prasmussen/gdrive/util"
"github.com/prasmussen/google-api-go-client/drive/v2"
+ "golang.org/x/net/context"
"io"
"mime"
"os"
@@ -288,7 +289,7 @@ func uploadFile(d *gdrive.Drive, input *os.File, inputInfo os.FileInfo, title st
fmt.Printf("Converting to Google Docs format enabled\n")
}
- info, err := d.Files.Insert(f).Convert(convert).Media(input).Do()
+ info, err := d.Files.Insert(f).Convert(convert).ResumableMedia(context.Background(), input, inputInfo.Size(), mimeType).Do()
if err != nil {
return fmt.Errorf("An error occurred uploading the document: %v\n", err)
}