Upload a file to Google Cloud, in a specific directory

前端 未结 6 1659
借酒劲吻你
借酒劲吻你 2021-02-04 04:31

How to upload a file on Google Cloud, in a specific bucket directory (e.g. foo)?

\"use strict\";

const gcloud = require(\"gcloud\");

const PROJECT         


        
6条回答
  •  野的像风
    2021-02-04 05:14

    I think just adding foo/ to the filename should work, like bucket.upload("foo/1.jpg", (err, file) ... In GCS, directories just a matter of having a '/' in the file name.

提交回复
热议问题