stevel05 Expert Licensed User Longtime User Jun 26, 2014 #1 What is the best way to send a file to javascript (in a webview)? As the attached project shows, using URI encode from android.net.URI (and JavaObject) and the corresponding javascript decodeURI, leaves some characters encoded ( same with StringUtils, encodeURL). It works if I use org.apache.commons.lang.StringEscapeUtils escapeEcmaScript method downloadable from: http://commons.apache.org/proper/commons-lang/download_lang.cgi (and JavaObject), but the lib is 400+k in size and the JS decode method is deprecated. I can also get it to work encoding with StringUtils in Base64 and using a js lib Base64 decoding lib from here: http://jsbase64.codeplex.com/releases/view/89265, that lib is just 6k. Has anyone found a way using the encoding currently available to encode a file? or is this something new I am trying? Attachments URIEncode.zip URIEncode.zip 13.9 KB · Views: 311
What is the best way to send a file to javascript (in a webview)? As the attached project shows, using URI encode from android.net.URI (and JavaObject) and the corresponding javascript decodeURI, leaves some characters encoded ( same with StringUtils, encodeURL). It works if I use org.apache.commons.lang.StringEscapeUtils escapeEcmaScript method downloadable from: http://commons.apache.org/proper/commons-lang/download_lang.cgi (and JavaObject), but the lib is 400+k in size and the JS decode method is deprecated. I can also get it to work encoding with StringUtils in Base64 and using a js lib Base64 decoding lib from here: http://jsbase64.codeplex.com/releases/view/89265, that lib is just 6k. Has anyone found a way using the encoding currently available to encode a file? or is this something new I am trying?