protected override JsonResult RunInBackground(params Java.Lang.Void[] @params) { Java.IO.File file = new Java.IO.File(uploadImagePath); long length = file.Length() / 1024; // Size in KB if (length > 500) { compressImage = CompressFile.compressImage(uploadImagePath); } else { compressImage = uploadImagePath; } jsonResult = RestSharpCall.PostFile <JsonResult>(compressImage, "Event/SetEventPicture?eventid=" + eventID + "&userId=" + GlobalClass.UserID); CompressFile.deleteTempFile(); return(jsonResult); }