SQLServerProvider that use Filetable instead of Filestream

Hello,

i looking for a save way to handle 'documents' (upload, download, change) on an IIS. So i create an ASP.Net Core hosted Blazor Wasm with Authentication via ASP.Net Identity and a SQL Server Database. Most info is stored in the database.

But there is a need for a 'document-store' = directory-hierarchies and files secure handeled on the server and up- and download functions on the Blazor Wasm.

So i think the SF File Manager is the ideal component for the Wasm!

But now i have to chose what is the best Provider on the Server!

The requirements are:

  1. Each user has it's own 'document-structure' and 'document-store' on the server

2. The transfer of 'documents' between Wasm and server should be as save as possible 

So there are 3 possible provider available:

ej2-aspcore-file-provider

ftp-aspcore-file-provider

sql-server-database-aspcore-file-provider

My preference is the SqlServer-provider but instead of Filestream i think the 'FileTable'-feature of SQLServer is the ideal choice! 

So my question:

Do you have any sample that use FileTable?

Do you have any recommandation for a secure transfer of files between Wasm and server?

Thanks for support

Patric



1 Reply

SA SureshRajan Alagarsamy Syncfusion Team August 21, 2024 03:31 PM UTC

Hi Patric,


We understand that you are looking to render the Syncfusion File Manager using a Blazor WASM template with an SQL File Provider for the server. We are pleased to inform you that the File Manager component can securely manage files and folders across various file systems. Additionally, we have a standardized response format that applies to all file system providers. This ensures seamless file operations, as long as you return the response data in the correct format, which we have outlined in the table below.


This implementation enables the use of the FilesTable, and all you need to do is return the response data according to the format outlined below. It also allows for the elimination of predefined file system provider handling, specifically in the SQL File Provider, giving you more control over file operations while ensuring smooth rendering and management of files and folders in the File Manager component.


You can find the default response format for file operations at the following link.


Documentation : https://blazor.syncfusion.com/documentation/file-manager/file-operations#request-and-response-contents-format-in-blazor-filemanager-component


Additionally, we have listed the response parameters for some of the basic operations in the table below.


S.No

File Operation

Example Response Parameters

1

Read

{

  cwd:

  {

      name:"Download",

      size:0,

      dateModified:"2019-02-28T03:48:19.8319708+00:00",

      dateCreated:"2019-02-27T17:36:15.812193+00:00",

      hasChild:false,

      isFile:false,

      type:"",

      filterPath:\\Download\\

  },

  files:[

      {

          name:"Sample Work Sheet.xlsx",

          size:6172,

          dateModified:"2019-02-27T17:23:50.9651206+00:00",

          dateCreated:"2019-02-27T17:36:15.8151955+00:00",

          hasChild:false,

          isFile:true,

          type:".xlsx",

          filterPath:\\Download\\

      }

  ],

  error:null,

  details:null

}

2

Upload

The upload response is an empty string.

3

Download

Downloads the requested items from the file server in response.

4

GetImage

Return the image as a file stream in response.

5

Create

{

  cwd: null,

  files: [

      {

          dateCreated: "2019-03-15T10:25:05.3596171+00:00",

          dateModified: "2019-03-15T10:25:05.3596171+00:00",

          filterPath: null,

          hasChild: false,

          isFile: false,

          name: "New",

          size: 0,

          type: ""

      }

  ],

  details: null,

  error: null

}

6

Rename

{

  cwd:null,

  files:[

      {

          name:"seaview.jpg",

          size:95866,

          dateModified:"2019-03-20T08:45:56+00:00",

          dateCreated:"2019-03-20T05:22:34.6214847+00:00",

          hasChild:false,

          isFile:true,

          type:".jpg",

          filterPath:\\Pictures\\Nature\\seaview.jpg

      }

  ],

  error:null,

  details:null

}

 

7

Move

{

  cwd:null,

  files:[

      {

          path:null,

          action:null,

          newName:null,

          names:null,

          name:"justin biber.mp4",

          size:0,

          previousName:"justin biber.mp4",

          dateModified:"2019-06-21T06:58:32+00:00",

          dateCreated:"2019-06-24T04:26:49.2690476+00:00",

          hasChild:false,

          isFile:true,

          type:".mp4",

          id:null,

          filterPath:\\Videos\\

      }

  ],

  error:null,

  details:null

}

 

8

Copy

{

  cwd:null,

  files:[

      {

          path:null,

          action:null,

          newName:null,

          names:null,

          name:"justin.mp4",

          size:0,

          previousName:"album.mp4",

          dateModified:"2019-06-21T06:58:32+00:00",

          dateCreated:"2019-06-24T04:22:14.6245618+00:00",

          hasChild:false,

          isFile:true,

          type:".mp4",

          id:null,

          filterPath:"\\"

      }

  ],

  error:null,

  details:null

}

 

9

Delete

{

  cwd: null,

  details: null,

  error: null,

  files: [

      {

          dateCreated: "2019-03-15T10:13:30.346309+00:00",

          dateModified: "2019-03-15T10:13:30.346309+00:00",

          filterPath: "\Hello\folder",

          hasChild: true,

          isFile: false,

          name: "folder",

          size: 0,

          type: ""

      }

  ]

}

 

10

Details

{

  cwd:null,

  files:null,

  error:null,

  details:

  {

      name:"All Files",

      location:\\Files\\FileContents\\All Files,

      isFile:false,

      size:"679.8 KB",

      created:"3/8/2019 10:18:37 AM",

      modified:"3/8/2019 10:18:39 AM",

      multipleFiles:false

  }

}

 



Additionally, We would like to inform you that the Blazor FileManager component provides the option to load a list of objects. This can be achieved by providing the response within the corresponding events. The Blazor FileManager can also be populated from an injected service, eliminating the need for HTTP client requests and backend URL configuration. This allows you to utilize your required service, such as physical, Amazon, Azure, etc., through the FileManager’s action events. This supports all file operations like delete, cut, copy, paste, new folder creation, upload, download, etc.


We have share a GitHub repository which contains flat data sample for your reference.


Sample : https://github.com/SyncfusionExamples/blazor-filemanager-with-flat-data/tree/master


Also we have shared the blogs, demos and user guide documentation which contains detailed information regarding the File Manager flat data service.


Blogs : https://www.syncfusion.com/blogs/post/render-flat-data-blazor-file-manager


Documentation : https://blazor.syncfusion.com/documentation/file-manager/data-binding#list-objects


Demos : https://blazor.syncfusion.com/demos/file-manager/flat-data?theme=fluent



We also offer to create a custom file provider specific to your needs to connect with the Syncfusion Blazor File Manager component, instead of relying on the predefined providers offered by Syncfusion. Additionally, you need to ensure that the file actions requests and responses adhere to the same format used in the file system which I shared above in table format.


For more details we suggest you refer the user guide documentation : https://blazor.syncfusion.com/documentation/file-manager/custom-file-provider


Check out the shared details and get back to us if you need any further assistance.


Regards,
Suresh.


Loader.
Up arrow icon