小编Tín*_*ang的帖子

ExcelJS 节点:页面中的水平居中和垂直居中不起作用

请帮助我。

我的流程:

使用文件 Tempate -> Code (Exceljs) -> 输出新文件

模板文件:

在此处输入图片说明 页面中心:

  • 水平:检查
  • 垂直:检查

源代码:

worksheet.pageSetup.horizontalCentered = true 
worksheet.pageSetup.verticalCentered = true
Run Code Online (Sandbox Code Playgroud)

但是文件输出:

  • 水平:取消选中
  • 垂直:取消选中

javascript node.js exceljs

7
推荐指数
1
解决办法
2135
查看次数

无法将文件从 Lambda 上传到 S3

我在本地主机上进行了测试,然后在 s3 上进行了检查,发现创建了一个新文件。但是在Lambda上测试时,虽然没有报错,但是S3上却没有文件。s3.upload(params).promise()的日志也不会显示。

var fs = require('fs');
var AWS = require('aws-sdk');
exports.handler = async (event, context, callback) => {
    context.callbackWaitsForEmptyEventLoop = false
    try {
        AWS.config.update({
            accessKeyId: accessKeyId,
            secretAccessKey: secretAccessKey
        });
        
        var s3 = new AWS.S3();
        var path = 'myfile.txt';
        var file_buffer =  fs.readFileSync(path);

        console.log(file_buffer);
        var params = {
            Bucket: 'bucket-dev',
            Key: '2222.txt',
            Body: file_buffer
        };
        console.log("1111");
        s3.upload(params).promise()
            .then(function(data) {
                console.log("Successfully uploaded to");
                callback(null, "All Good");
            })
            .catch(function(err) {
                console.error(err, err.stack);
                callback(err);
            });
        console.log("2222");
       return context.logStreamName
    } catch (err) {
        console.log(err); …
Run Code Online (Sandbox Code Playgroud)

amazon-s3 amazon-web-services node.js aws-lambda

1
推荐指数
1
解决办法
2003
查看次数