canhduckhong opened a new issue, #636:
URL: https://github.com/apache/cordova-plugin-file/issues/636

   # Bug Report
   
   ## Problem
   I got this error when trying to write a binary string into file.
   
   `this._realReader.readAsArrayBuffer is not a function. (In 
'this._realReader.readAsArrayBuffer(file)', 
'this._realReader.readAsArrayBuffer' is undefined)
   `
   The error is thrown at FileReader.js, line 302.
   `FileReader.prototype.readAsArrayBuffer = function (file) {
       if (initRead(this, file)) {
           return this._realReader.readAsArrayBuffer(file);
       }
   
       const totalSize = file.end - file.start;
       readSuccessCallback.bind(this)('readAsArrayBuffer', null, file.start, 
totalSize, function (r) {
           const resultArray = (this._progress === 0 ? new 
Uint8Array(totalSize) : new Uint8Array(this._result));
           resultArray.set(new Uint8Array(r), this._progress);
           this._result = resultArray.buffer;
       }.bind(this));
   };`
   
   Here is how I call the FileWriter in my code:
   `writeBlobToFile = (file: FileEntry, blob): angular.IPromise<void> => {
           return this.$q((resolve, reject) => {
               file.createWriter((fileWriter) => {
                   fileWriter.write(blob);
                   fileWriter.onwriteend = resolve;
                   fileWriter.onerror = reject;
               }, reject);
           });
       };`
   
   Currently I can only reproduce it on iOS, version 17.6 and version 18.0.
   
   ### Environment, Platform, Device
   iOS 17.6 and iOS 18.0
   iPhone 13 Plus
   
   ### Version information
   cordova-plugin-file version 8.1.0
   cordova-ios version 7.1.0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to