javascript - Upload photo into facebook from html5 canvas -


in jsp page, have manipulated photo within html5 canvas , want upload facebook upon clicking upload button.

facebooktype publishphotoresponse = facebookclient.publish("me/photos", facebooktype.class, binaryattachment.with("test.jpeg", getclass().getresourceasstream("xxx")), parameter.with("message", "test"));  out.println("published photo id: " + publishphotoresponse.getid()); 

i using restfb uploading part in servlet. however, have no clue attribute needed me pass on servlet side processing (for example: "xxx"). when used todataurl, url of image base64. facebook api allows me upload photo using base64 format?

var base64url = document.getelementbyid('canvasimg').src; var decodedurl = escape(window.atob(base64url)); alert(decodedurl); 

the above coding seems contain error won't display alert. should decode base64 data first before handling on servlet or should pass whole base64 data servlet handle decoding?


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -