0
我試圖上載條紋上傳驗證文件具有低於流星方法:條紋fileUploader給出錯誤的fakepath
我傳遞包含該用戶識別文件的目的是要上載帶服務器進行驗證。
當我寫了下面的方法來上傳圖片文件,該文件是條紋服務器上的PNG它給了我一個錯誤說
"Error: ENOENT, no such file or directory 'C:\fakepath\success.png']"
Meteor.methods({
fileUploader("C:\\fakepath\\success.png"){ // path only for reference purpose
let fp = fs.readFileSync("C:\\fakepath\\success.
let StripefileUpload = new Future();
let file;
Stripe.fileUploads.create({
purpose: 'identity_document',
file: {
data: fp,
name: 'success.png',
type: 'application/octet-stream'
}
}, function(err, fileUpload) {
if (err) {
console.log(err);
StripefileUpload.return(err);
} else {
file = fileUpload.id;
console.log(file);
StripefileUpload.return(file);
}
});
return StripefileUpload.wait();
}
})