Reputation: 1
I am able to read file
let txtfilepath = __dirname + 'text.txt'
var params = {
enter code here
Bucket: bucketname,
Key: filepathInS3
};
S3.getObject(params, function(err, data){
if (err)
console.error(err.code, "-", err.message);
return (err);
enter code here
fs.writeFile(txtfilepath, data.Body, function(err){
if(err)
console.log(err.code, "-", err.message);
return (err);
});
});
getting error - read-only file system
Upvotes: 0
Views: 514
Reputation: 10832
The only directory you can write to in the Lambda execution environment is /tmp
, all other folders are read-only.
Upvotes: 3