This topic answers common questions about file uploads in Drive and Photo Service, including instant uploads, resumable uploads, delays in storage usage updates, and troubleshooting upload failures.
What is the difference between an instant upload and a pre-check for an instant upload?
After I upload a file, why is my drive storage usage not updated immediately?
Difference between instant upload and pre-check
Instant upload is based on the SHA-1 hash of the entire file. When you create a file, the server calculates its full SHA-1 hash. If this hash matches an existing record, the upload completes instantly.
A pre-check for an instant upload is an optimization for large files. Calculating the full SHA-1 hash for a large file can be time-consuming. The pre-check process first reads the initial 1 KB of the file and calculates its hash. If no matching record exists for this 1 KB hash, the file is not eligible for an instant upload, and the process terminates early to avoid an unnecessary full hash calculation. If a match is found for the 1 KB hash, the server proceeds to calculate the SHA-1 hash of the entire file to confirm if an instant upload is possible.
Delayed update of drive storage
PDS updates drive storage usage asynchronously. After an upload completes, the storage usage data typically refreshes within 2 to 3 seconds.
Granularity of instant upload
Instant upload operates at the file level. After you upload a file, the server calculates and stores its SHA-1 hash. Any subsequent uploads of files with the same hash trigger an instant upload.
Resumable uploads
Yes. Resumable uploads work by splitting a file into multiple parts that you can upload independently. The smallest resumable unit is a single part. You cannot resume an upload from the middle of a part.
Common causes of upload failures
When using hosting mode, upload failures are often caused by incorrectly configured Cross-Origin Resource Sharing (CORS) rules. Check the CORS rules for your OSS bucket to ensure that the origin, request method, and request header are all included in the allowlist.
Uploads can also fail if you exhaust the drive's storage quota. In this case, the API returns the
QuotaExhaustederror code.