Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion AutoUpdater.NET/DownloadUpdateDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ private void WebClientOnDownloadFileCompleted(object sender, AsyncCompletedEvent
}
}

string fileName = string.IsNullOrEmpty(contentDisposition?.FileName)
string fileName = !string.IsNullOrEmpty(_args.DownloadFileName)
? _args.DownloadFileName:
string.IsNullOrEmpty(contentDisposition?.FileName)
? Path.GetFileName(_webClient.ResponseUri.LocalPath)
: contentDisposition.FileName;

Expand Down
6 changes: 6 additions & 0 deletions AutoUpdater.NET/UpdateInfoEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ public UpdateInfoEventArgs()
Mandatory = new Mandatory();
}

/// <summary>
/// It will be prioritized if provided. Used in cases where the download URL does not contain a file name (e.g., Base64) or the header does not include Content-Disposition
/// </summary>
[XmlElement("filename")]
public string DownloadFileName { get; set; }

/// <summary>
/// If new update is available then returns true otherwise false.
/// </summary>
Expand Down