diff options
| author | Petter Rasmussen | 2015-02-23 22:53:40 +0100 |
|---|---|---|
| committer | Petter Rasmussen | 2015-02-23 22:53:40 +0100 |
| commit | 8002119ffb5f5ce549c0b82959c59d685e45fb99 (patch) | |
| tree | 5b77be2e50a15f51cf0eb360873c6878cfe69026 /cli/cli.go | |
| parent | a6e12715812da5103915c56d09f2ed9c4b7af1a7 (diff) | |
| download | gdrive-8002119ffb5f5ce549c0b82959c59d685e45fb99.tar.bz2 | |
Use resumable upload
Diffstat (limited to 'cli/cli.go')
| -rw-r--r-- | cli/cli.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) } |
