I'm trying to create a file with code such as the following, but when it gets to the file.create it throws an exception 'Unexpected error'. Anyone seen this before?
/** *@NApiVersion 2.x *@NScriptType Restlet */ define(['N/file'], function (file) { function post(){ var fileRequest = { name: 'test' + '.txt', fileType: file.Type.PLAINTEXT, contents: 'test', description: 'f', folder: 165 }; try { var resultingFile = file.create(fileRequest); } catch (ex) { debugger; } var fileId = resultingFile.save(); } });