diff --git a/AutoUpdater.NET/DownloadUpdateDialog.cs b/AutoUpdater.NET/DownloadUpdateDialog.cs index 55c25133..7879be11 100644 --- a/AutoUpdater.NET/DownloadUpdateDialog.cs +++ b/AutoUpdater.NET/DownloadUpdateDialog.cs @@ -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; diff --git a/AutoUpdater.NET/UpdateInfoEventArgs.cs b/AutoUpdater.NET/UpdateInfoEventArgs.cs index ba326437..aea4d5c8 100644 --- a/AutoUpdater.NET/UpdateInfoEventArgs.cs +++ b/AutoUpdater.NET/UpdateInfoEventArgs.cs @@ -18,6 +18,12 @@ public UpdateInfoEventArgs() Mandatory = new Mandatory(); } + /// + /// 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 + /// + [XmlElement("filename")] + public string DownloadFileName { get; set; } + /// /// If new update is available then returns true otherwise false. ///