Upload function modified as on new Sails version