Hi,
I am working on a Premiere Pro panel and I basically want to upload a selected file from the current project to a remote server. Using a html input file tag and select a file works fine to upload a file.
So my idea was to create a File object which i would then upload. Something like :
upload() {
var path = '/Users/me/my_file.mp3';
// read all bytes from file likely using : window.cep.fs.readFile(path)
var file = new File ([data], 'my_file.mp3');
// call POST to start upload. That part is done and work.
}
As I am going step by step, my current code looks like :
upload() {
var file = new File( ['my random content'] ,'random_name.txt');
// call POST to start upload. That part is done and work.
}
It works works fine if run it in up to date Chrome (I also tried with an much older version (41.0.2272.89), which works too). Unfortunately, it crashes in Premiere and I have no clue why.
The crash happens on this line :
var file = new File(['my random content'], 'random_name.txt');
(a basic copy/paste in chrome console show that it works on regular chrome, and crash when paste in the remote debug console.)
with this error message :
Uncaught TypeError: File constructor cannot be called in nwdisabled frame.
message: "File constructor cannot be called in nwdisabled frame."
stack: (...)
get stack: function () { [native code] }
set stack: function () { [native code] }
__proto__: Error
VM110:2(anonymous function)
VM77:847InjectedScript._evaluateOn
VM77:780InjectedScript._evaluateAndWrap
VM77:646 InjectedScript.evaluate
Any explanation and suggestion to work around that issue would be greatly appreciated.