Hello,
I've encountered the same problem as descibed in issue 282 : http://aspnetwebstack.codeplex.com/workitem/282 . While I was digging into the issue i discovered that the bugfix as was checked in in the changeset https://aspnetwebstack.codeplex.com/SourceControl/changeset/bd530cd86f2e was not present in the assembly i was using (see attachment).
This is the source i got from decompiling the assembly i have got:
public override Stream GetStream(HttpContent parent, HttpContentHeaders headers)
{
string str;
if (parent == null)
{
throw Error.ArgumentNull("parent");
}
if (headers == null)
{
throw Error.ArgumentNull("headers");
}
try
{
string localFileName = this.GetLocalFileName(headers);
str = Path.Combine(this._rootPath, Path.GetFileName(localFileName));
}
catch (Exception exception1)
{
Exception exception = exception1;
throw Error.InvalidOperation(exception, Resources.MultipartStreamProviderInvalidLocalFileName, new object[0]);
}
MultipartFileData multipartFileDatum = new MultipartFileData(headers, str);
this._fileData.Add(multipartFileDatum);
return File.Create(str, this._bufferSize, FileOptions.Asynchronous);
}
The last line should be :
return File.Create(str, this._bufferSize, FileOptions.Asynchronous | FileOptions.WriteThrough);
according to the above mentioned changeset.
I got this assembly via NuGet when adding a reference to the web api 2.1 package.
Could you confirm this? And if so, how can i get my hands on the assembly containing the fix, so that i get on with my current project for our client?
Thanks a lot
Comments: I just saw that in the actual source code for the release the fix is not present? => https://aspnetwebstack.codeplex.com/SourceControl/latest#src/System.Net.Http.Formatting/MultipartFileStreamProvider.cs
I've encountered the same problem as descibed in issue 282 : http://aspnetwebstack.codeplex.com/workitem/282 . While I was digging into the issue i discovered that the bugfix as was checked in in the changeset https://aspnetwebstack.codeplex.com/SourceControl/changeset/bd530cd86f2e was not present in the assembly i was using (see attachment).
This is the source i got from decompiling the assembly i have got:
public override Stream GetStream(HttpContent parent, HttpContentHeaders headers)
{
string str;
if (parent == null)
{
throw Error.ArgumentNull("parent");
}
if (headers == null)
{
throw Error.ArgumentNull("headers");
}
try
{
string localFileName = this.GetLocalFileName(headers);
str = Path.Combine(this._rootPath, Path.GetFileName(localFileName));
}
catch (Exception exception1)
{
Exception exception = exception1;
throw Error.InvalidOperation(exception, Resources.MultipartStreamProviderInvalidLocalFileName, new object[0]);
}
MultipartFileData multipartFileDatum = new MultipartFileData(headers, str);
this._fileData.Add(multipartFileDatum);
return File.Create(str, this._bufferSize, FileOptions.Asynchronous);
}
The last line should be :
return File.Create(str, this._bufferSize, FileOptions.Asynchronous | FileOptions.WriteThrough);
according to the above mentioned changeset.
I got this assembly via NuGet when adding a reference to the web api 2.1 package.
Could you confirm this? And if so, how can i get my hands on the assembly containing the fix, so that i get on with my current project for our client?
Thanks a lot
Comments: I just saw that in the actual source code for the release the fix is not present? => https://aspnetwebstack.codeplex.com/SourceControl/latest#src/System.Net.Http.Formatting/MultipartFileStreamProvider.cs