Repository navigation
List Bucket and List File #478
Copy link
Copy link
Closed
Labels
🚨This issue needs some love.This issue needs some love.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.triage meI really want to be triaged.I really want to be triaged.
Description
Activity
ok i find the metod for to have bucket list and file list:
// list all BUCKET storage.getBuckets(function(err, buckets, nextQuery) { for(var i = 0; i<buckets.length; i++ ){ // The `metadata` property is populated for you with the metadata at the // time of fetching. console.log(buckets[i].metadata.id); } }); // list all file bucket.getFiles(function(err, files, nextQuery) { // The `metadata` property is populated for you with the metadata at the // time of fetching. for(var i = 0; i<files.length; i++ ){ // The `metadata` property is populated for you with the metadata at the // time of fetching. console.log(files[i].metadata.name); } // However, in cases where you are concerned the metadata could have // changed, use the `getMetadata` method. //files[0].getMetadata(function(err, metadata) {}); });
but now i have another question...
is possible to create a folder in the bucket?
thanks a lot
if you create file in path doesn't exist google will create the folders for you
- addedapi: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.
on Apr 6, 2015 As far as I know, that's the only way to create a folder outside of the Developer's Console UI. I think the solution of uploading a file and having a folder created in the process is fine, but feel free to correct me if you have a use case where that's not fine.
yes, is true...
function(err,httpResponse,body){ var responseJson = JSON.parse(body); if(responseJson.success){ callToFunctionInModule("Start Upload in GoogleStorage", cb); var image = bucket.file('ddsImage.dds'); fs.createReadStream(__dirname + '../../temp/ddsConversion/' + folderName + '/ddsImage.dds') .pipe(image.createWriteStream()) .on('error', function(err) { console.log(err); }) .on('complete', function() { } console.log('The file upload is complete.'); }); } });The folder temp doesn't exist. The first time google create the folder id doesn't exist.
but if i need to remove the folder? I sow the method for remove file and buket but not for remove a folder,
Thanks a lot
- added🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.
on Apr 7, 2020 - added a commit that references this issue
on Sep 27, 2022 - added a commit that references this issue
on Nov 9, 2022 18 remaining items
- added a commit that references this issue
on Feb 4, 2026 - added a commit that references this issue
on Feb 5, 2026 - added a commit that references this issue
on Feb 23, 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 18, 2026 - added a commit that references this issue
on Mar 27, 2026 - added a commit that references this issue
on May 5, 2026
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.triage meI really want to be triaged.I really want to be triaged.
Hi all,
sorry but There isn't documentation about that.
is possible to have a bucket list and file list?
thanks