Is there any way to upload files greater than 10MB...
# ask-stanley-ai
a
Is there any way to upload files greater than 10MB in file cabinet?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it appears that NetSuite has a limitation where you cannot upload files greater than 10MB directly to the file cabinet. This is due to the SSS_File_CONTENT_SIZE_EXCEEDED error that is thrown when trying to create a file larger than 10MB. However, there is a workaround suggested in the threads. You can use the
File.appendLine
method to add content to the file line by line, instead of all at once. This method allows you to bypass the 10MB limit, as you're not creating the file all at once, but rather building it up gradually. Here is an example of how you might use this method:
Copy code
javascript
var fileObj = file.create({
    name: 'myFile.csv',
    fileType: file.Type.CSV,
});

var data = getData(); // Assume this is your data source
for (var i = 0; i < data.length; i++) {
    fileObj.appendLine({
        value: data[i]
    });
}

var fileId = fileObj.save();
In this example,
getData
is a hypothetical function that retrieves the data you want to write to the file. The
appendLine
method is used in a loop to add each line of data to the file individually. Remember, this method might not work in all cases, especially if you're using a third-party parser or if you need to read the file content after saving it. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.890612066
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.853672802
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.853578329
Please provide your feedback on this answer.