<@U4MF2CN20> Try to load the file and without getC...
# suitescript
a
@suitedev Try to load the file and without getContent change the type... then getContent..
s
I didn't think you can change the type?
a
And you are right:
This property is read-only. You must set the file type by passing in a file.Type enum value to file.create(options).
s
Yes, but I'm not creating the file..
It's uploaded in the file cabinet
a
This is why my initial idea does not work and you are right hahaha
s
lolz.. it's a silly situation.
a
Work around... create a copy, rename it, get the content... get rid of the copy when you are done...
s
#shitshow
a
netsuite
s
I think they just need to add my file type to this list of known file types.
hell, they already work with these files elsewhere
.odz
.ofx
var ofxFile = file.load({ id: '1345' });
var ofxContents = ofxFile.getContents();
// If the type is 'Other Binary File', the 'isText' property will be false
if (!ofxFile.isText) {
ofxContents = encode.convert({
string: ofxContents,
inputEncoding: encode.Encoding.BASE_64,
outputEncoding: encode.Encoding.UTF_8
});
}