Hi, I am getting below error in my safe browser when I tried to execute “Upload” operation.
Below is the error. I am trying to use safeMutable insert.
Code
function uploadVideo() { //basically id becomes a container and to be defined as below. var container = 'apps/safetube-vijay'; var _file = document.getElementById("vfile"); var _reader = new FileReader(); var _content = null; _reader.readAsArrayBuffer(new Blob([_file.files[0]])); _reader.onload = function(_event) { var arrayBuffer = _reader.result; _content = new Uint8Array(arrayBuffer); return _content; }; window.safeApp.getContainer(auth, container) .then((mdHandle) => { window.safeMutableData.newMutation(auth) .then((mutationHandle) => window.safeMutableDataMutation.insert(mutationHandle, _file.files[0].name, _content).then(() => console.log('New mutation entry has been committed to the network'))); }, (err) => { console.error(err); }); }
Please check the error below. Please help me to find what is causing the error. This error happens to be new. I was able to upload before with the same code before.
Uncaught (in promise) Error: Cannot read property ‘buffer’ of null
** at Array.slice.call.forEach.item (C:\Program Files\MaidSafe\safe-browser\resources\app\node_modules@maidsafe\safe-node-app\src\native_mutable.js:121:55)**
** at Array.forEach (native)**
** at Function.strToBuffer (C:\Program Files\MaidSafe\safe-browser\resources\app\node_modules@maidsafe\safe-node-app\src\native_mutable.js:120:46)**
** at Promise (C:\Program Files\MaidSafe\safe-browser\resources\app\node_modules@maidsafe\safe-node-app\src\native_base.js:97:32)**
** at Promise ()**
** at Object.mdata_entry_actions_insert (C:\Program Files\MaidSafe\safe-browser\resources\app\node_modules@maidsafe\safe-node-app\src\native_base.js:92:16)**
** at Object.insert (C:\Program Files\MaidSafe\safe-browser\resources\app\node_modules@maidsafe\safe-node-app\src\api\mutable.js:174:16)**
** at C:\Program Files\MaidSafe\safe-browser\resources\app\node_modules\beaker-plugin-safe-app\dist\api.js:2831:23**
** at **