file.load(options)
Method Description |
Loads an existing file from the NetSuite File Cabinet. The file size limit for this method is 2GB. |
Returns |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
10 units |
Module |
|
Since |
2015.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
number | string |
required |
The identifier of a file in the File Cabinet. To specify a file in the File Cabinet, you can pass one of the following as the value of this parameter:
To find the internal ID of the file in the UI, select Documents > Files > File Cabinet. |
2015.2 |
Errors
Error Code |
Message |
Thrown If |
---|---|---|
|
You do not have access to the media item you selected. |
Internal ID passed is invalid. |
|
That record does not exist. path: {path} |
Relative file path passed is invalid. |
|
<name of missing parameter> |
A required argument is not passed. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/file Module Script Samples.
// Add additional code
...
var fileObj = file.load({
id: 'Images/myImageFile.jpg'
});
fileObj.description = 'my test file';
var fileId = fileObj.save();
...
// Add additional code