toDataURL("image/png") to Facebook Upload
Now that I have this data, I can't figure out how to let people submit it to facebook! I tried using the FB.ui() function but it seems to only let me share an established link. If I try to share the stored data, Facebook replies my url is too long. How can I have that data upload to facebook instead of linking?
Is this impossible? I've looked everywhere, and I have not found a suitable answer. I know facebook is horribly documented!
The photo connection of the user object in the graph API (https://developers.facebook.com/docs/reference/api/user/) has a source property. This is where you will place the data content (multipart/form-data) of your photo.
Once you upload the photo data to the user account, it is placed in an album specially for your application. You will get the id of the new photo from the FB.api('me/photos','post',params,callbackFn); call.
Using that photo id, you can get it's url and use it however you want. You can even use it to post to the user's wall for everyone to see.