mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
HTTPDownloader creates directory for its destination
This commit is contained in:
parent
5ba0514a0e
commit
4965f78c07
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
@ -95,7 +96,6 @@ namespace Wabbajack.Lib.Downloaders
|
||||
{
|
||||
}
|
||||
|
||||
;
|
||||
if (stream.IsFaulted || response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
Utils.Log($"While downloading {Url} - {stream.Exception.ExceptionToString()}");
|
||||
@ -111,6 +111,7 @@ namespace Wabbajack.Lib.Downloaders
|
||||
|
||||
var contentSize = headerVar != null ? long.Parse(headerVar) : 1;
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(destination));
|
||||
|
||||
using (var webs = stream.Result)
|
||||
using (var fs = File.OpenWrite(destination))
|
||||
|
Loading…
Reference in New Issue
Block a user