Alexander Cuadros
03/10/2024, 12:20 AMhi every one, i have the next code: function saveFile(fileField) {
var fileObj = file.create({
name: fileField.name,
fileType: fileField.fileType,
contents: fileField.getContents(),
folder: 4165
});
var fileId = fileObj.save();
return fileId;
}
[19:20] and i need use it to upload a public_key.pem file but it is showing this error: Error: {"type":"error.SuiteScriptError","name":"SSS_INVALID_TYPE_ARG","message":"You have entered an invalid type argument: MISCBINARY","id":"","stack":["Error\n at saveFile (/SuiteScripts/0004 - Card/SD_SL_UploadPemFile.js8728)\n at Object.principalFunction (/SuiteScripts/0004 - Card /SD_SL_UploadPemFile.js3634)"],"cause":{"type":"internal error","code":"SSS_INVALID_TYPE_ARG","details":"You have entered an invalid type argument: MISCBINARY","userEvent":null,"stackTrace":["Error\n at saveFile (/SuiteScripts/0004 - Card /SD_SL_UploadPemFile.js8728)\n at Object.principalFunction (/SuiteScripts/0004 - Card /SD_SL_UploadPemFile.js3634)"],"notifyOff":false},"notifyOff":false,"userFacing":true}
[19:20] but when i save a .txt file it works fine, do you know what is the error? thanks!!James Pak
03/10/2024, 1:52 AMJames Pak
03/10/2024, 1:52 AMbattk
03/10/2024, 8:30 AMbattk
03/10/2024, 8:30 AMbattk
03/10/2024, 8:31 AMMISCBINARY
type file yourself, so use the one you have