See the attached repro program.
In the test scenario, the client keep uploading file and the controller is expected to delete it once the read is finished. Occasionally the deletion will fail because some process is handling the file.
Comments: Hello, This bugfix doesn't seem to be deployed in at least one NuGet package containing the attached assembly : Microsoft.AspNet.WebApi.Client.5.1.1 The attached assembly (file version 5.1.20129) has contains the following inplementation of the function GetStream: public override Stream GetStream(HttpContent parent, HttpContentHeaders headers) { if (parent == null) { throw Error.ArgumentNull("parent"); } if (headers == null) { throw Error.ArgumentNull("headers"); } string text; try { string localFileName = this.GetLocalFileName(headers); text = Path.Combine(this._rootPath, Path.GetFileName(localFileName)); } catch (Exception innerException) { throw Error.InvalidOperation(innerException, Resources.MultipartStreamProviderInvalidLocalFileName, new object[0]); } MultipartFileData item = new MultipartFileData(headers, text); this._fileData.Add(item); return File.Create(text, this._bufferSize, FileOptions.Asynchronous); } Please note the last line. According to the commited fix (http://aspnetwebstack.codeplex.com/SourceControl/changeset/changes/bd530cd86f2e ) the content of that last line should be: return File.Create(text, this._bufferSize, FileOptions.Asynchronous | FileOptions.WriteThrough); Could you confirm this, and if so, where could i get the assembly actually containing the fix? Thanks in advance
In the test scenario, the client keep uploading file and the controller is expected to delete it once the read is finished. Occasionally the deletion will fail because some process is handling the file.
Comments: Hello, This bugfix doesn't seem to be deployed in at least one NuGet package containing the attached assembly : Microsoft.AspNet.WebApi.Client.5.1.1 The attached assembly (file version 5.1.20129) has contains the following inplementation of the function GetStream: public override Stream GetStream(HttpContent parent, HttpContentHeaders headers) { if (parent == null) { throw Error.ArgumentNull("parent"); } if (headers == null) { throw Error.ArgumentNull("headers"); } string text; try { string localFileName = this.GetLocalFileName(headers); text = Path.Combine(this._rootPath, Path.GetFileName(localFileName)); } catch (Exception innerException) { throw Error.InvalidOperation(innerException, Resources.MultipartStreamProviderInvalidLocalFileName, new object[0]); } MultipartFileData item = new MultipartFileData(headers, text); this._fileData.Add(item); return File.Create(text, this._bufferSize, FileOptions.Asynchronous); } Please note the last line. According to the commited fix (http://aspnetwebstack.codeplex.com/SourceControl/changeset/changes/bd530cd86f2e ) the content of that last line should be: return File.Create(text, this._bufferSize, FileOptions.Asynchronous | FileOptions.WriteThrough); Could you confirm this, and if so, where could i get the assembly actually containing the fix? Thanks in advance