Open Closed

Add table relationship to FileManager #2212


User avatar
0
jhsanc created
  • ABP Framework version: v5.0.0 rc.1
  • UI type: Blazor Wasm
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes It's possible add relationship of my table to FileManager Tables?. And I saw Blazorise FileEdit Component but the Changed="@OnChanged" this event was never triggered, do you have any example to use this component to upload files into FileManager module.

Thank you,


4 Answer(s)
  • User Avatar
    0
    jhsanc created

    If I do this: private async Task OnFileChanged(FileChangedEventArgs e) {

                foreach (var file in e.Files)
                {
                    // A stream is going to be the destination stream we're writing to.
                    using (var stream = new MemoryStream())
                    {
                        
                        var fileInputWithStream = new CreateFileInputWithStream();
    
                        await file.WriteToStreamAsync(stream);
    
                        fileInputWithStream.File = new RemoteStreamContent(stream, file.Name, file.Type);
    
                    // Here we're telling the FileEdit where to write the upload result
    
                        
                        fileInputWithStream.Name = "Prueba";
    
                        await FileDescriptorAppService.CreateAsync(null, fileInputWithStream);
    
                        // Once we reach this line it means the file is fully uploaded.
                        // In this case we're going to offset to the beginning of file
                        // so we can read it.
                        stream.Seek(0, SeekOrigin.Begin);
    
                    }
                }
    

    Throw my request is invalid.

  • User Avatar
    0
    jhsanc created

    Hello, can you close this question and refund?, because not was anwared many days.

    Thank you,

  • User Avatar
    0
    cotur created

    Hello,

    sorry for late reply, the credit is refunded.

    Yes, you can create relations with File Management tables with your own tables.

    Just configure File Management entities on with Entity Framework model builder.

  • User Avatar
    0
    jhsanc created

    Thank you cotur.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11