Uploading an image to picasa using a DataURL String
===

I am using HTML5 to create a 'camera' application that is totally web based. (without phonegap)

I now have a DataURL that I obtained as follows

    canvas.getContext("2d").drawImage(video, 0, 0, 640, 480, 0, 0, 640, 480);
    var img = canvas.toDataURL("image/png");

Am I able upload this to picasa once I send this as a String to the server side?

The following code didnt work and gave me a "com.google.gdata.util.InvalidEntryException: OK
Not an image." exception. (imgStr is the DataURL above)

    MediaByteArraySource imageByteArr = new MediaByteArraySource(imgStr.getBytes("UTF-16LE"), "image/jpeg");
    myPhoto.setMediaSource(imageByteArr);
    PhotoEntry returnedPhoto = client.insert(imagePostUrl, myPhoto);

Thanks in advance
