plupload
plupload copied to clipboard
[plupload 3.1.2] getNative no longer works
I am trying to compute the SHA1 hash of a file before uploading it with plupload. There are some javascript implementations out there that are able to do that, but I need access to the blob of the file that gets selected in the plupload GUI. I have seen some examples (for plupload 2x) that use getNative() to get the blob. That no longer works with version 3.1.2 I get the following error:
Uncaught TypeError: this.getFile is not a function
at r.getNative (plupload.full.min.js:29)
at a.UploadFile (<anonymous>:29:23)
at a.dispatchEvent (plupload.full.min.js:29)
at a.trigger (plupload.full.min.js:13)
at r.<anonymous> (plupload.full.min.js:29)
at Array.<anonymous> (plupload.full.min.js:13)
at n (plupload.full.min.js:13)
at Object.d [as inSeries] (plupload.full.min.js:13)
at r.dispatchEvent (plupload.full.min.js:13)
at r.trigger (plupload.full.min.js:13)
at r.<anonymous> (plupload.full.min.js:29)
at Array.<anonymous> (plupload.full.min.js:13)
at n (plupload.full.min.js:13)
at Object.d [as inSeries] (plupload.full.min.js:13)
at r.dispatchEvent (plupload.full.min.js:13)
at r.trigger (plupload.full.min.js:13)
at r.start (plupload.full.min.js:29)
at r.upload (plupload.full.min.js:29)
at r.start (plupload.full.min.js:29)
at a (plupload.full.min.js:29)
at a.start (plupload.full.min.js:29)
at HTMLAnchorElement.<anonymous> (jquery.plupload.queue.js:315)
at HTMLAnchorElement.dispatch (jquery-3.3.1.min.js:2)
at HTMLAnchorElement.y.handle (jquery-3.3.1.min.js:2)
The code calling the function:
UploadFile : function (up, file) {
var myfile = file.getNative();
},
I also encountered this problem, how can I solve it?
I could not solve it. I switched to http://www.resumablejs.com/
From: "波比小金刚" [email protected] To: moxiecode/plupload [email protected] Cc: StripeBanana [email protected], Author [email protected] Date: 06-07-2018 10:56 Subject: Re: [moxiecode/plupload] [plupload 3.1.2] getNative no longer works (#1560)
I also encountered this problem, how can I solve it? ― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
@StripeBanana en~ thx!
plupload v3.1.2
FilesAdded,but error: Uncaught TypeError: this.getFile is not a function
and plupload v2.3.6 is ok!
I also encountered this problem, how can I solve it?
plupload v3.1.2
use 'files[0].getSource().getSource()' instead of 'files[0].getNative()'
FilesAdded: function(up, files) {
files[0].getSource().getSource()
}
FilesAdded: function(up, files) { plupload.each(files, function(file,index) { var reader = new window.FileReader(); reader.readAsDataURL(files[index].getSource().getSource()); } }
plupload v3.1.3 the Plupload.File object .getNative() fn still throws an uncaught TypeError "this.getFile is not a function".
files[0].getSource().getSource() chaining is not clear as to what will be returned whereas .getNative() on a Plupload.File object is much more succinct.
Is it now possible? How to solve it
@StripeBanana恩~谢谢! Is it now possible? How to solve it