Merge remote-tracking branch 'zznty/master'
# Conflicts: # Torch.API/Torch.API.csproj # Torch/Patches/ScriptCompilerPatch.cs
This commit is contained in:
@@ -68,7 +68,11 @@ namespace Torch.API.WebAPI
|
||||
return false;
|
||||
}
|
||||
var s = await h.Content.ReadAsStreamAsync();
|
||||
#if !NETFRAMEWORK
|
||||
await using var fs = new FileStream(path, FileMode.Create);
|
||||
#else
|
||||
using var fs = new FileStream(path, FileMode.Create);
|
||||
#endif
|
||||
await s.CopyToAsync(fs);
|
||||
return true;
|
||||
}
|
||||
|
@@ -78,7 +78,11 @@ namespace Torch.API.WebAPI
|
||||
if(File.Exists(path))
|
||||
File.Delete(path);
|
||||
|
||||
#if NETFRAMEWORK
|
||||
using var f = File.Create(path);
|
||||
#else
|
||||
await using var f = File.Create(path);
|
||||
#endif
|
||||
await s.CopyToAsync(f);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
Reference in New Issue
Block a user