How do I upload an image of the canvas to an Amazon S3 bucket using an AJAX post?

So I'm using node.js and express.js to set up a local server. I want to be able to save the canvas as a png and then upload that png to an AS3 bucket using the aws-sdk.

This is the code I have that posts to the local server.

module.saveScreen=function(){
    var screenName=currentPage;
    if(screenName!='Intro' && screenName!=null){

        if(data.reachedReview == true){
            screenName=screenName+'Revised';
        }

        var diagram=canvas.toDataURL('image/png');

        var dataToSend={
            screenName:screenName,
            participantNumber:participantNumber,
            surveyId:data.surveyId,
            diagram:diagram
        };
        var dataToSendStr=JSON.stringify(dataToSend);

        var settings={
            processData:false,
            url: 'saveScreen',
            dataType:'text',
            contentType:'application/json',
            type:'POST',
            data:dataToSendStr,

            success: function(data){
                console.log('success');
            },
            error: function(err,textStatus,errorThrown){
                console.log('error saving data');
                console.log('error textStatus: '+textStatus);
                console.log('error errorThrown: '+errorThrown);
                return;
            }               
        };
        $.ajax(settings);
    }
};

Here's the server-side code that will upload the image to AS3:

app.post('/saveScreen',function(req,res){
    aws.config.loadFromPath('./aws-config.json');
    var s3 = new aws.S3({params: {Bucket: S3_BUCKET} });

    var pn=req.body.participantNumber;
    var surveyId=req.body.surveyId;
    var screenName = req.body.screenName;
    var pngFile=pn+'/'+surveyId+"/"+screenName+".png";

    var body = req.body.diagram;

    var params = {
        Bucket: S3_BUCKET,
        Key: pngFile,
        ACL: 'public-read-write',
        Body: body,
        ContentType: 'image/png',
        ContentEncoding: 'application/json; charset=utf-8'
    };

    s3.putObject(params, function(err, data){
        if(err){ console.log("Error: " + err); }
        else{ console.log("Sending Image Success: " + data); }
    });

     res.json(req.body);
});

I did something similar for some data from the user that's stored as an xml, put in an object, stringified, and posted. That works fine, but this isn't working for the image.

I'm not sure exactly where the problem is. I think it's an encoding issue, but I've tried many different combinations of encoding/decoding and nothing has worked so far.

Any help?