Passing FileList file to server imagemagick method

I’m trying to pass files from the client to imagemagick (on the server) to decrease quality.

var uploads =, function(file) {

        var uploader = new Slingshot.Upload("listingImages");'convertImage', file, function(err, response) {

          file = response;

          uploader.send(file, function(error, downloadUrl) {

            var url = downloadUrl;
            if (error) {
              console.error("Error Uploading", uploader.xhr.response);
            } else {}



I use the convertImage method to convert the image and return the converted image.

The problem is imagemagick seems to think I’m not passing the file.
To my current knowledge event.currentTarget.files contains all the files but maybe this is not the case.

My server method looks like the following:

 convertImage: function(image){
        var file = gm(image).setFormat("jpg");
        file = gm(image).quality(20);
        return file;

How can I return the modified image and pass it back into client code?

I looked at FileReader API, and uploading files but I’m not sure if the content is still relevant.