@namespace Oqtane.Modules.Admin.Files @inherits ModuleBase @inject NavigationManager NavigationManager @inject IFileService FileService @inject IFolderService FolderService @if (folders != null) {

Cancel } @code { public override SecurityAccessLevel SecurityAccessLevel { get { return SecurityAccessLevel.Admin; } } string url = ""; List folders; int folderid = -1; protected override async Task OnInitializedAsync() { folders = await FolderService.GetFoldersAsync(ModuleState.SiteId); if (PageState.QueryString.ContainsKey("id")) { folderid = int.Parse(PageState.QueryString["id"]); } } private async Task Download() { try { if (url != "" && folderid != -1) { await FileService.UploadFileAsync(url, folderid); await logger.LogInformation("File Downloaded Successfully From Url {Url}", url); AddModuleMessage("File Downloaded Successfully From Url", MessageType.Success); } else { AddModuleMessage("You Must Enter A Url And Select A Folder", MessageType.Warning); } } catch (Exception ex) { await logger.LogError(ex, "Error Downloading File From Url {Url} {Error}", url, ex.Message); AddModuleMessage("Error Downloading File From Url. Please Verify That The Url Is Valid.", MessageType.Error); } } }