Repository navigation
Figure out how to do browser-based uploading, and document it well. #641
Description
Activity
- addedapi: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.
on Jun 6, 2015 @jgeewax @stellanhaglund will this solution work?
- Docs: https://cloud.google.com/storage/docs/access-control?hl=en#signing-resumable
- Issue: Authorization: Bearer your_auth_token (how to get auth_token) #818
- Solution: Authorization: Bearer your_auth_token (how to get auth_token) #818 (comment)
(this can be simplified with https://googlecloudplatform.github.io/gcloud-node/#/docs/v0.21.0/storage/file?method=createResumableUpload)
I made a couple of examples here showing two different ways to handle uploads. https://github.com/stephenplusplus/gcloud-upload-example
Thanks alot!!
I just added that but now I'm trying to download a file using
app.get('/file/:imageId', function(req, res){
var remoteFile = bucket.file(req.params.imageId);
var localFilename = 'uploads/' + req.params.imageId;var src = remoteFile.createReadStream()
src
.on('error', function(err) {})
.on('response', function(response) {
// Server connected and responded with the specified status and headers.
})
.on('end', function() {
// The file is fully downloaded.
})
// .pipe(fs.createWriteStream(localFilename));res.attachment(localFilename);
src.pipe(res);})
but for larger files I just get about 1.2 mb downloaded..
2015-09-17 1:27 GMT+02:00 Stephen Sawchuk [email protected]:
I made a couple of examples here showing two different ways to handle
uploads. https://github.com/stephenplusplus/gcloud-upload-example—
Reply to this email directly or view it on GitHub
#641 (comment)
.Which version of gcloud are you running?
"gcloud": "^0.21.0",2015-09-17 15:28 GMT+02:00 Stephen Sawchuk [email protected]:
Which version of gcloud are you running?
—
Reply to this email directly or view it on GitHub
#641 (comment)
.Hmm, I haven't been able to reproduce. How large are the files you're having trouble with? I've tried with a 10MB file without issues.
I added onto the example with some options of how to download files: https://github.com/stephenplusplus/gcloud-upload-example/blob/1d6cbecb31aa2dcd98d1c8177e6c474b80b5d1f5/server.js#L89
about 300mb, and the files will probably be up to some gb's
2015-09-17 16:16 GMT+02:00 Stephen Sawchuk [email protected]:
Hmm, I haven't been able to reproduce. How large are the files you're
having trouble with? I've tried with a 10MB file without issues.I added onto the example with some options of how to download files:
https://github.com/stephenplusplus/gcloud-upload-example/blob/1d6cbecb31aa2dcd98d1c8177e6c474b80b5d1f5/server.js#L89—
Reply to this email directly or view it on GitHub
#641 (comment)
.Would you mind opening a new issue about this? Also, please test that it still doesn't work isolated from express, e.g.:
remoteFile.createReadStream().pipe(fs.createWriteStream('./backup-file'))
I think we've got this one covered with
file#createResumableUpload().Related, I just stumbled upon this project over the weekend: https://github.com/makeomatic/ms-files-gce
If there's more we can do, let me know!
18 remaining items
- added a commit that references this issue
on Feb 5, 2026 - added a commit that references this issue
on Feb 5, 2026 - added a commit that references this issue
on Feb 17, 2026 - added a commit that references this issue
on Feb 23, 2026 - added a commit that references this issue
on Feb 25, 2026 - added a commit that references this issue
on Feb 26, 2026 - added a commit that references this issue
on Feb 26, 2026 - added a commit that references this issue
on Mar 12, 2026 - added 2 commits that reference this issue
on Mar 17, 2026 - added a commit that references this issue
on Mar 18, 2026 - added a commit that references this issue
on Mar 27, 2026 - added a commit that references this issue
on May 5, 2026
So there's this concept of "browser-based uploads" which basically is the following process:
filewhich is10mband has metadata ={...}).So... a couple of questions:
Note that we're not wiring together any RPCs or anything. Just providing a method that takes a policy and spits back a signature for the user to serialize and send around however they want.
upload(or similar) using the policy document and signature.The code I'm expecting here would look like...
Server-side:
Client-side:
/cc @Capstan