@model int @inject IDownloadService downloadService @using Nop.Services.Media @{ //other variables var randomNumber = CommonHelper.GenerateRandomInteger(); var clientId = "download" + randomNumber; var download = await downloadService.GetDownloadByIdAsync(Model); var disableUrl = Convert.ToBoolean(ViewData["nop.DownloadEditor.DisableUrl"] ?? false); var files = new List(); if (download != null) { var fileName = $"{download.Filename ?? download.DownloadGuid.ToString()}{download.Extension}"; files.Add( new { source = fileName, options = new { type = "local", file = new { name = fileName, size = download.DownloadBinary?.Length, type = download.ContentType }, metadata = new { url = Url.Action("DownloadFile", "Download", new { downloadGuid = download.DownloadGuid, area = AreaNames.ADMIN }) } } }); } } @* register CSS and JS *@
@if (!disableUrl) {
checked="checked" } />
}
value="@(download.DownloadUrl)" } />