You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blazor/file-manager/getting-started-with-server-app.md
+39-3Lines changed: 39 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,25 @@ Add the Syncfusion Blazor FileManager component in the **~/Pages/Index.razor** f
106
106
{% endhighlight %}
107
107
{% endtabs %}
108
108
109
+
## Create Models
110
+
111
+
Create a new folder named `Models` in the server project. Add the necessary model files to this folder for handling file operations. Download the `PhysicalFileProvider.cs` and `Base` folder from this [repository](https://github.com/SyncfusionExamples/ej2-aspcore-file-provider/tree/master/Models) and place them in the Models folder.
112
+
113
+
## Create a new folder controller
114
+
115
+
To initialize a local service, create a new folder name with `Controllers` inside the server part of the project. Then, create a new file `FileManagerController` with extension `.cs` inside the `Controllers` folder.
116
+
117
+
Make sure your controller `FileManagerController.cs` uses the model classes you've created. Import the model namespace at the top of your controller file
118
+
119
+
File Manager's base functions are available in the below namespace.
120
+
```cshtml
121
+
using Syncfusion.EJ2.FileManager.Base;
122
+
````
123
+
File Manager's operations are available in the below namespace.
124
+
````cshtml
125
+
using Syncfusion.EJ2.FileManager.PhysicalFileProvider;
126
+
````
127
+
109
128
## Initialize the service in controller
110
129
111
130
File Manager supports the basic file actions like Read, Delete, Copy, Move, Get Details, Search, Rename, and Create New Folder.
@@ -125,7 +144,7 @@ using Microsoft.AspNetCore.Http.Features;
125
144
using Syncfusion.EJ2.FileManager.Base;
126
145
//File Manager's operations are available in the below namespace.
127
146
using Syncfusion.EJ2.FileManager.PhysicalFileProvider;
128
-
using Newtonsoft.Json;
147
+
using System.IO;
129
148
using System.Linq;
130
149
using System.Threading.Tasks;
131
150
@@ -196,10 +215,27 @@ app.MapControllers();.
196
215
197
216
This will configure and map the controller in your Blazor App.
198
217
199
-
To access the above File Operations, you need some model class files that have file operations methods. So, create `Models` folder in `server` part of the application and download the `PhysicalFileProvider.cs` and `Base` folder from the [this](https://github.com/SyncfusionExamples/ej2-aspcore-file-provider/tree/master/Models) link in the Models folder.
218
+
## Create Web Server App
200
219
201
-
Add your required files and folders under the `wwwroot\Files` directory.
220
+
Add the Syncfusion Blazor FileManager component in `~/Pages/Index.razor` file.
Add your required files and folders under the `wwwroot\Files` directory.
237
+
* In your project, the `wwwroot` directory is where static files are served from. It is typically found at the root level of your server project.
238
+
* Inside the `wwwroot` directory, create a new folder named `Files`. This will be used to store static files like images, documents, or other resources that you want to serve directly.
203
239
* Press <kbd>Ctrl</kbd>+<kbd>F5</kbd> (Windows) or <kbd>⌘</kbd>+<kbd>F5</kbd> (macOS) to launch the application. This will render the Syncfusion Blazor FileManager component in your default web browser.
Copy file name to clipboardExpand all lines: blazor/file-manager/getting-started-with-wasm-app.md
+39-3Lines changed: 39 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,25 @@ Add the Syncfusion Blazor FileManager component in the **~/Pages/Index.razor** f
104
104
{% endhighlight %}
105
105
{% endtabs %}
106
106
107
+
## Create Models
108
+
109
+
Create a new folder named `Models` in the server project. Add the necessary model files to this folder for handling file operations. Download the `PhysicalFileProvider.cs` and `Base` folder from this [repository](https://github.com/SyncfusionExamples/ej2-aspcore-file-provider/tree/master/Models) and place them in the Models folder.
110
+
111
+
## Create a new folder controller
112
+
113
+
To initialize a local service, create a new folder name with `Controllers` inside the server part of the project. Then, create a new file `FileManagerController` with extension `.cs` inside the `Controllers` folder.
114
+
115
+
Make sure your controller `FileManagerController.cs` uses the model classes you've created. Import the model namespace at the top of your controller file
116
+
117
+
File Manager's base functions are available in the below namespace.
118
+
```cshtml
119
+
using Syncfusion.EJ2.FileManager.Base;
120
+
````
121
+
File Manager's operations are available in the below namespace.
122
+
````cshtml
123
+
using Syncfusion.EJ2.FileManager.PhysicalFileProvider;
124
+
````
125
+
107
126
## Initialize the service in controller
108
127
109
128
File Manager supports the basic file actions like Read, Delete, Copy, Move, Get Details, Search, Rename, and Create New Folder.
@@ -123,7 +142,7 @@ using Microsoft.AspNetCore.Http.Features;
123
142
using Syncfusion.EJ2.FileManager.Base;
124
143
//File Manager's operations are available in the below namespace.
125
144
using Syncfusion.EJ2.FileManager.PhysicalFileProvider;
To access the above File Operations, you need some model class files that have file operations methods. So, create `Models` folder in `server` part of the application and download the `PhysicalFileProvider.cs` and `Base` folder from the [this](https://github.com/SyncfusionExamples/ej2-aspcore-file-provider/tree/master/Models) link in the Models folder.
205
+
## Create Blazor WebAssembly App
187
206
188
-
Add your required files and folders under the `wwwroot\Files` directory.
207
+
Add the Syncfusion Blazor FileManager component in `~/Pages/Index.razor` file.
Add your required files and folders under the `wwwroot\Files` directory.
224
+
* In your project, the `wwwroot` directory is where static files are served from. It is typically found at the root level of your server project.
225
+
* Inside the `wwwroot` directory, create a new folder named `Files`. This will be used to store static files like images, documents, or other resources that you want to serve directly.
190
226
* Press <kbd>Ctrl</kbd>+<kbd>F5</kbd> (Windows) or <kbd>⌘</kbd>+<kbd>F5</kbd> (macOS) to launch the application. This will render the Syncfusion Blazor FileManager component in your default web browser.
Copy file name to clipboardExpand all lines: blazor/file-manager/getting-started-with-web-app.md
+63-5Lines changed: 63 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,11 +106,29 @@ Add the Syncfusion Blazor FileManager component in `.razor` file inside the `Pag
106
106
{% endhighlight %}
107
107
{% endtabs %}
108
108
109
+
## Create Models
110
+
111
+
Create a new folder named `Models` in the server project. Add the necessary model files to this folder for handling file operations. Download the `PhysicalFileProvider.cs` and `Base` folder from this [repository](https://github.com/SyncfusionExamples/ej2-aspcore-file-provider/tree/master/Models) and place them in the Models folder.
112
+
113
+
## Create a new folder controller
114
+
115
+
To initialize a local service, create a new folder name with `Controllers` inside the server part of the project. Then, create a new file `FileManagerController` with extension `.cs` inside the `Controllers` folder.
116
+
117
+
Make sure your controller `FileManagerController.cs` uses the model classes you've created. Import the model namespace at the top of your controller file
118
+
119
+
File Manager's base functions are available in the below namespace.
120
+
```cshtml
121
+
using Syncfusion.EJ2.FileManager.Base;
122
+
````
123
+
File Manager's operations are available in the below namespace.
124
+
````cshtml
125
+
using Syncfusion.EJ2.FileManager.PhysicalFileProvider;
126
+
````
127
+
109
128
## Initialize the service in controller
110
129
111
130
File Manager supports the basic file actions like Read, Delete, Copy, Move, Get Details, Search, Rename, and Create New Folder.
112
-
113
-
To initialize a local service, create a new folder name with `Controllers` inside the server part of the project. Then, create a new file `FileManagerController` with extension `.cs` inside the `Controllers` folder and add the following code in that file.
131
+
To perform the action add the following code in that `FileManagerController.cs` file.
To configure and map the controller, open the `~/Program.cs` file of the server part of the application. Add the following code to configure the service for the controller and map the controller after `app.UseRouting()`:
206
+
To configure and map the controller, open the `~/Program.cs` file of the server part of the application. Add the following code to configure the service for the controller and map the controller after `app.UseRouting()`. The `app.UseRouting()` middleware should be placed after `app.UseHttpsRedirection()`. The correct ordering is essential to ensure proper request handling and middleware functionality:
189
207
190
208
```cshtml
191
209
@@ -200,10 +218,50 @@ app.MapControllers();.
200
218
201
219
This will configure and map the controller in your Blazor App.
202
220
203
-
To access the above File Operations, you need some model class files that have file operations methods. So, create `Models` folder in `server` part of the application and download the `PhysicalFileProvider.cs` and `Base` folder from the [this](https://github.com/SyncfusionExamples/ej2-aspcore-file-provider/tree/master/Models) link in the Models folder.
221
+
## Create Web App
222
+
223
+
Add the Syncfusion Blazor FileManager component in `.razor` file inside the `Pages` folder.
Blazor supports different interactive modes for server-side rendering:
242
+
243
+
* Interactive Server Render Mode: This mode allows Blazor components to be rendered on the server, sending the HTML to the client while maintaining interactive capabilities. It provides a balance between server-side processing and client-side responsiveness.
244
+
245
+
* To enable this mode, configure the `Program.cs` file in your Blazor project using the `AddInteractiveServerRenderMode` method.
246
+
````cshtml
247
+
builder.Services.AddRazorComponents()
248
+
.AddInteractiveServerComponents();
249
+
````
250
+
Define a render mode at top of the component, as follows:
251
+
252
+
{% tabs %}
253
+
{% highlight razor %}
254
+
255
+
@* desired render mode define here *@
256
+
@rendermode InteractiveServer
257
+
258
+
{% endhighlight %}
259
+
{% endtabs %}
204
260
205
261
Add your required files and folders under the `wwwroot\Files` directory.
206
262
263
+
* In your project, the `wwwroot` directory is where static files are served from. It is typically found at the root level of your server project.
264
+
* Inside the `wwwroot` directory, create a new folder named `Files`. This will be used to store static files like images, documents, or other resources that you want to serve directly.
207
265
* Press <kbd>Ctrl</kbd>+<kbd>F5</kbd> (Windows) or <kbd>⌘</kbd>+<kbd>F5</kbd> (macOS) to launch the application. This will render the Syncfusion Blazor FileManager component in your default web browser.
0 commit comments