/// <summary> /// HTTP PUT file from path to HTTP action f, updating action with progress every 500ms. /// </summary> /// <param name="action">Action on which to update the progress</param> /// <param name="timeout">Timeout value in ms</param> /// <param name="path">path of file to put</param> public static String Put(AsyncAction action, int timeout, string path, string hostname, Delegate f, params object[] p) { Session session = action.Session; action.RelatedTask = XenAPI.Task.create(session, "uploadTask", hostname); try { HTTP.UpdateProgressDelegate progressDelegate = delegate(int percent) { action.Tick(percent, action.Description); }; return Put(progressDelegate, action.GetCancelling, timeout, action.Connection, action.RelatedTask, ref session, path, hostname, f, p); } finally { action.Session = session; Task.destroy(session, action.RelatedTask); } }