将PDF文件存储到Node.js文件系统

时间:2019-07-03 06:25:23

标签: node.js mongoose

我有一个发布路线,它保存了所有数据,然后有PDF文件,但是现在我想将其保存到fs,但是会出现错误

       Match      Team1         Team2         Winner 
       0      Australia       England      Australia 
       1        England     Australia      Australia    
       2          India     Australia      Australia
       3        England         India        England

这是模型 report.js

The "path" argument must be one of type string, Buffer, or URL. Received type object

api.js

  name:String,
    age:Number,
    customerDetails:String,
    userReport:{
    user:String,
    reportDate:String, 
    pdf:{
    data:Buffer,
    contentType:Schema.Types.Mixed
    }
}

0 个答案:

没有答案