/// <summary> /// Overwrite file by id and stream /// </summary> /// <param name="id">File id to overwrite.</param> /// <param name="streamCreator">Func returning Stream for data. Can be called multiple times if retry happened. Stream will be closed by method.</param> /// <returns>Node info for overwritten file</returns> public async Task <AmazonNode> Overwrite(string id, Func <Stream> streamCreator) { var url = string.Format("{0}nodes/{1}/content", await amazon.GetContentUrl().ConfigureAwait(false), id); var file = new FileUpload { StreamOpener = streamCreator, FileName = id, FormName = "content" }; return(await http.SendFile <AmazonNode>(HttpMethod.Put, url, file).ConfigureAwait(false)); }