Sunday, 12 March 2017

How to store Excel file in s3 using aws-sdk in node js?

    var xls = json2xls(data);
    var bufferdata = new Buffer(xls).toString('base64');
    console.log("inside upload s3 function........", data);
    //var buf = new Buffer(data, 'base64');
    var uploaddata = {
        Key: "exception.xls",
        Body: bufferdata,
        ContentEncoding: 'base64',
        ContentType: 'application/vnd.ms-excel'
    };

I am able to save and retrieve the file over s3. But Format mismatch is coming up. Please help me as how to solve this.



via Jinav Shah

No comments:

Post a Comment