Comments (9)
I experimented resumable upload. Here are my findings
- need to local patch google-api-go-client
https://groups.google.com/forum/#!topic/golang-nuts/QlUQWq061XA
otherwise you will get"resumable uploads must set the Name parameter. "
error. - good news is, no longer auth error when push huge file (issue #53, #116)
I succeeded uploaded a 22GB file in 214 minutes. - The upload chunk size is hard coded 256kb. You may want to local patch the chunk size. Otherwise it is very slow.
For my case, 22GB/214minutes = 1.76MB/s
Compared to my non-resumable upload 4.5MB/s - Bad news: uploaded file name always become "Untitled"
I found google-api-go-client has this line
req.Body = nil
so the file name is not sent to server.
I don't know how to fix it yet.
from drive.
Thank you for investigating these. Actually I mostly calcuate upload chunk sizes, but have a default. For some services like AWS's S3, for multi part uploads, the chunks should be something like 5MBs size minimum. I'll see how we what's up as we step through the code when implementing it. If need be, we shall patch the Go api client. I actually already have a clone at https://github.com/odeke-em/google-api-go-client in case we need to fix it for our uses.
from drive.
FYI, my experiment code kcwu@a4d9a33
from drive.
Nice. However, you might need to change a whole bunch of things related to resumable uploads. You need to actually start a resumable upload session and then save the resumable upload URI token and pass that on every request. To get more information on this, checkout https://developers.google.com/drive/web/manage-uploads#resumable
from drive.
Oh btw we shall need a mechanism for saving that info either in memory or to disk for every resumable upload, in scenarios like on Interrupt (Ctrl + C) as well as on upload fails and then read from there on the next retrial. Also we need to get in a retry mechanism, I have a simple lib started for exponential back-off so that we can detect when an upload might have failed while the data is still in memory.
from drive.
If we only want to "resume" in the same upload process, google-api-go-client already did handle these session/token/retry things.
BTW, current implementation of google-api-go-client requires file size known before upload start. If we want to support -piped upload, we have to hack google-api-go-client as well.
from drive.
But resumable uploads are necessary if for example someone hits Ctrl-C as well as if you get a network error so we still to save this information.
Yeah we shall see about that, or for a simple start use resumable uploads only for stat-able files.
from drive.
@kcwu, just a heads-up there should no longer be OAuth timeout errors.
from drive.
@kcwu Happy New Year! Just as a random note: I was about to go to bed and tried pushing up a few files but saw the need to change the chunksize, so I implemented #840.
from drive.
Related Issues (20)
- Exporting GoogleDoc files only, ignore any other files HOT 1
- drive-gen doesn't work with modules (default in go 1.17) HOT 2
- http2/transport.go:417:45: undefined: os.ErrDeadlineExceeded HOT 2
- Organizer and FileOrganizer roles missing for share
- Is there a way to erase the pushed files after drive push?
- moving directories with -keep-parent does not work anymore due to changes by Google
- read-only access
- Installing executables is deprecated HOT 1
- Error 500 retrieving certain documents
- Installation Instructions for Mint (Ubuntu derivitives) from source
- Detected as Trojan:Win32/Sabsik.TE.A!ml by Windows Defender
- platform_packages.md is heavily outdated
- panic: invalid page type: 163: 10 HOT 1
- Folder Shortcuts
- OOB OAuth deprecation: migrate to OAuth loopback mechanism HOT 5
- 'go get' is no longer supported outside a module. HOT 4
- Fedora Copr repository no longer exists
- drive init generates link that returns Error 400: invalid_request HOT 12
- Unable to install on Ubuntu 22.04 HOT 1
- Access blocked: drive for Google Driveโs request is invalid HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drive.