Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
175
rated 0 times [  180] [ 5]  / answers: 1 / hits: 6015  / 10 Years ago, thu, july 10, 2014, 12:00:00

I have a Blob object inside my WebView, how can I pass it to Android?

I want to save it to local file on device.



I been trying to use:



var url = webkitURL.createObjectURL(myBlob);


But I wasn't been able to download it to device.


More From » android

 Answers
11

I found a solution by converting the blob to Base64 String



 var reader = new window.FileReader();
reader.readAsDataURL(blob);
reader.onloadend = function() {
var base64data = reader.result;
// send base64data string to android as a method param
}

[#43963] Thursday, July 10, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ellisw

Total Points: 625
Total Questions: 92
Total Answers: 88

Location: Kazakhstan
Member since Mon, Sep 26, 2022
2 Years ago
ellisw questions
Mon, Aug 23, 21, 00:00, 3 Years ago
Fri, Nov 20, 20, 00:00, 4 Years ago
Sat, Jun 20, 20, 00:00, 4 Years ago
Tue, Apr 21, 20, 00:00, 4 Years ago
;