According to API docs, storage/File.createWriteStream should take a boolean option public that makes the uploaded file publicly readable. However, in my experience this isn't the case.
I create the stream like this:
let cloudFileStream = cloudFile.createWriteStream({
public: true,
resumable: false,
})
And still, I have to call cloudFile.makePublic after the upload has finished, because otherwise the file is only accessible to the owner:
cloudFileStream
.on('finish', () => {
cloudFile.makePublic()
})
Environment details
- OS: OS X El Capitan
- Node.js version: 6.4.0
- npm version: 3.10.6
- google-cloud-node version: 0.39.0