如何自动将文件上传到Netsuite文件柜?
会nLapiRequestURL("Server1/database1/NDT/ftp.csv
工作吗?
要从公司内的服务器获取文件。
我需要每天自动将CSV文件导入文件柜。
答案 0 :(得分:1)
我认为最简单的方法是:
示例代码:
var response = nlapiRequestURL('http://yourserver.yourcompany.com/somecsvfile.csv');
var csvDataInBase64 = response.getBody();
var file = nlapiCreateFile('mycsv.csv', 'CSV', csvDataInBase64);
nlapiSubmitFile(file);
没有错误检查或该示例中的任何内容,但它应该让您开始。
如果安全性很重要(请参阅上面的第1点!),您最好通过Web服务发送文件。有关详细信息,请参阅https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/SuiteTalkWebServices.html。