Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

Hello

I foung a weird behavior about file manager.

if i put it inside a dialog, it will not show the files but only when i deploy it in production, it work if i run it locally.

If i not put in dialog but just in a page, it work, both locally and in production


Snippet
@using Newtonsoft.Json
@using Syncfusion.Blazor.Buttons
@using Syncfusion.Blazor.Popups
@using Syncfusion.Blazor.FileManager
@using TestingCore.Core.Utility
@using ToolSet.Models.Loggers
@page "/FileTestComponent"
 
 
<button @onclick=ShowDialog>open</button>
 
 
<SfDialog @ref="Dialog" Width="70vw" IsModal="true" ShowCloseIcon="true" Visible=false Header="File Manager">
    <DialogTemplates>
        <Content>
            <SfFileManager @ref=FileManager TValue="FileManagerDirectoryContent" Height="800px" AllowDragAndDrop=@AllowDrag>
                <FileManagerEvents TValue="FileManagerDirectoryContent" OnFileOpen="fileOpen"></FileManagerEvents>
 
                <FileManagerAjaxSettings Url="@Url"
                                         GetImageUrl="@ImageUrl"
                                         DownloadUrl="@DownloadUrl"
                                         UploadUrl="@UploadUrl">
                </FileManagerAjaxSettings>
                <FileManagerContextMenuSettings File="@ContextItems" Folder="@ContextItems"></FileManagerContextMenuSettings>
                <FileManagerToolbarSettings ToolbarItems=@ToolBarItems></FileManagerToolbarSettings>
            </SfFileManager>
        </Content>
        <FooterTemplate>
            <SfButton IsPrimary=true OnClick=CloseDialog>Close</SfButton>
        </FooterTemplate>
    </DialogTemplates>
</SfDialog>
 
 
 
 
 @code{
 
 
    public string Url { get; set; }
    public string UploadUrl { get; set; }
    public string DownloadUrl { get; set; }
    public string ImageUrl { get; set; }
 
 
    public List<ToolBarItemModel> ToolBarItems = new List<ToolBarItemModel>();
 
    public string[] ContextItems = new string[] { "Open", "|", "Delete", "Download", "Rename", "|", "Details" };
 
    public bool AllowDrag { get; set; } = true;
 
    SfFileManager<FileManagerDirectoryContent> FileManager { get; set; }
 
 
    SfDialog Dialog;
 
 
 
 
    public async void fileOpen(FileOpenEventArgs<FileManagerDirectoryContent> args)
    {
        try
        {
            string dataString = JsonConvert.SerializeObject(args.FileDetails);
            Dictionary<string, dynamic> fileDetails = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(dataString);
 
            string fullPath = _softwareConfiguration.SoftwareFullAddress + "\\MainFolder\\19"
                                + fileDetails["FilterPath"] + fileDetails["Name"];
 
            if (fileDetails["IsFile"])
            {
                var type = fileDetails["Type"];
 
                switch (type)
                {
                    case WindowsFileType.Zip:
                        break;
                    case WindowsFileType.Pptx:
                        await _JS.InvokeVoidAsync("OpenFile", fullPath);
                        break;
                    case WindowsFileType.Pdf:
                        await _JS.InvokeVoidAsync("OpenFile", fullPath);
                        break;
                    case WindowsFileType.Docx:
                    case WindowsFileType.Doc:
                        await _JS.InvokeVoidAsync("OpenFile", fullPath);
                        break;
                    case WindowsFileType.Rtf:
                    case WindowsFileType.Txt:
                        await _JS.InvokeVoidAsync("OpenFile", fullPath);
                        break;
                    case WindowsFileType.Dib:
                    case WindowsFileType.Jpg:
                    case WindowsFileType.Jpeg:
                    case WindowsFileType.Jpe:
                    case WindowsFileType.Jfif:
                    case WindowsFileType.Gif:
                    case WindowsFileType.Tif:
                    case WindowsFileType.Tiff:
                    case WindowsFileType.Png:
                    case WindowsFileType.Ico:
                    case " .Jpg":
                    case ".JPG":
                        args.Cancel = true;
                        await _JS.InvokeVoidAsync("OpenFile", fullPath);
                        break;
                    default:
                        await _JS.InvokeVoidAsync("OpenFile", fullPath);
                        break;
                }
            }
        }
        catch (Exception ex)
        {
            await _logger.Write(ex.ToString(), LogField.General);
            throw;
        }
    }
 
    public async Task CloseDialog()
    {
        //chiude la finestra di dialogo
        await this.Dialog.HideAsync();
    }
 
 
    public async Task ShowDialog()
    {
    
        var myRole = _userService.GetCurrentUser().Role;
        // var serverName = "localhost";
 
 
        var serverName = "luss0042";
 
        Url = $"http://{serverName}:565/api/FileManagerTestingCore/FileOperations/19/{(int)myRole}";
        UploadUrl = $"http://{serverName}:565/api/FileManagerTestingCore/Upload/19/{(int)myRole}";
        DownloadUrl = "http://{serverName}:565/api/FileManagerTestingCore/Download";
        ImageUrl = $"http://{serverName}:565/api/FileManagerTestingCore/GetImage/19";
        //chiude la finestra di dialogo
        await this.Dialog.ShowAsync();
        await Task.Delay(1000);
 
 
        this.StateHasChanged();
 
    }
 
 
 
    }
         

Please can you check?
thank you!

Maurizio Meloni