This might help everyone. I just solved the issue when uploaded file to space, by default is set to private. This is how you can change it to public. Full code, btw this is node:
const
s3 = require('s3'),
GV = require('/path/to/config/file');
let client = s3.createClient({
s3Options: {
accessKeyId: GV.digitalOcean.spaces.key,
secretAccessKey: GV.digitalOcean.spaces.secret,
region: GV.digitalOcean.spaces.region,
endpoint: GV.digitalOcean.spaces.endpoint
},
});
let
params = {
localDir: '/local/path/file',
deleteRemoved: true,
s3Params: {
Bucket: GV.digitalOcean.spaces.bucketName,
Prefix: '/remote/path/file',
ACL: 'public-read' // this should set the file to Public
},
},
uploader = client.uploadDir(params);
uploader.on('error', function(err) {
console.error("unable to sync:", err.stack);
});
uploader.on('progress', function() {
console.log("progress", uploader.progressAmount, uploader.progressTotal);
});
uploader.on('end', function() {
console.log('done');
});
It is becoming a regular basis that I find myself on one of these DO support pages, reading about an issue (AND SOLUTIONS) that have been completely ignored for years. The longer I am with DO, the more I lose faith that they even care about customers any more.
Yet another reason to move away from DO rather than trying to embrace their services. Not being able to bulk update the permissions of a bucket, is ridiculous. This was raised 2 and a half years ago DO… WAKE UP???