0

Using cordova 2.6.0. And a plugin on the android side.

The issue is that i am trying to pass a base-64 string to my plugin, but there was an error :

java.lang.IllegalArgumentException: bad base-64

Tried to debug it and found that there is a mismatch in size between the sent base-64 string from javascript(from cordova.exec function) and the received plugin in java. The size of the string in java is nearly half of the original string.

Verified the same by pasting both strings in a browser. Browser displayed the image for the javascript part and not for the java part.

Also tried to stringify the JSON object (containing the base-64 string), and pass it to the plugin. But then also there is a mismatch in size(same as above).

Have tried for different images, receiving the same result.

A solution is to break the sent base-64 string to some parts and use it again on the java/plugin side.

I am receiving the arguments in a JSON Array, there might be a limit in that maybe. M not sure.

Hope some one can help and tell where am I going wrong.

Danyal
  • 448
  • 4
  • 18
  • 1
    this is just a guess... but maybe your post size is to large – Philipp Sander Jun 12 '13 at 10:28
  • @PhilippSander : Yes the size is large. I sent a small sized base-64 string, and received it fully in the plugin. Thats why asked the question, how large is too large ? – Danyal Jun 12 '13 at 11:52
  • http://stackoverflow.com/questions/2364840/what-is-the-size-limit-of-a-post-request – Philipp Sander Jun 12 '13 at 11:55
  • @PhilippSander : Sorry for replying so late, thanks for the effort man!! But now m pretty sure that its using something GET like instead of POST like, to call the PLUGIN method.(as GET has a limit on payload size and POST does not) – Danyal Jun 13 '13 at 10:50
  • 1
    okay... my fault... but good i got you on the right track :) – Philipp Sander Jun 14 '13 at 06:43

0 Answers0