Skip to content

Commit 5d61645

Browse files
Merge pull request #4835 from Syncfusion-Content/hotfix/hotfix-v26.2.4
DOCINFRA-2341_merged_using_automation
2 parents 215429f + 5e643f3 commit 5d61645

File tree

3 files changed

+141
-11
lines changed

3 files changed

+141
-11
lines changed

blazor/file-manager/getting-started-with-server-app.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,25 @@ Add the Syncfusion Blazor FileManager component in the **~/Pages/Index.razor** f
106106
{% endhighlight %}
107107
{% endtabs %}
108108

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+
109128
## Initialize the service in controller
110129
111130
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;
125144
using Syncfusion.EJ2.FileManager.Base;
126145
//File Manager's operations are available in the below namespace.
127146
using Syncfusion.EJ2.FileManager.PhysicalFileProvider;
128-
using Newtonsoft.Json;
147+
using System.IO;
129148
using System.Linq;
130149
using System.Threading.Tasks;
131150
@@ -196,10 +215,27 @@ app.MapControllers();.
196215

197216
This will configure and map the controller in your Blazor App.
198217

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
200219

201-
Add your required files and folders under the `wwwroot\Files` directory.
220+
Add the Syncfusion Blazor FileManager component in `~/Pages/Index.razor` file.
221+
222+
{% tabs %}
223+
{% highlight razor %}
202224

225+
<SfFileManager TValue="FileManagerDirectoryContent">
226+
<FileManagerAjaxSettings Url="/api/FileManager/FileOperations"
227+
UploadUrl="/api/FileManager/Upload"
228+
DownloadUrl="/api/FileManager/Download"
229+
GetImageUrl="/api/FileManager/GetImage">
230+
</FileManagerAjaxSettings>
231+
</SfFileManager>
232+
233+
{% endhighlight %}
234+
{% endtabs %}
235+
236+
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.
203239
* 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.
204240

205241
![Blazor FileManager Component](images/blazor-filemanager-component.png)

blazor/file-manager/getting-started-with-wasm-app.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@ Add the Syncfusion Blazor FileManager component in the **~/Pages/Index.razor** f
104104
{% endhighlight %}
105105
{% endtabs %}
106106

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+
107126
## Initialize the service in controller
108127
109128
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;
123142
using Syncfusion.EJ2.FileManager.Base;
124143
//File Manager's operations are available in the below namespace.
125144
using Syncfusion.EJ2.FileManager.PhysicalFileProvider;
126-
using Newtonsoft.Json;
145+
using System.IO;
127146
using System.Linq;
128147
using System.Threading.Tasks;
129148
@@ -183,10 +202,27 @@ namespace filemanager.Server.Controllers
183202
{% endhighlight %}
184203
{% endtabs %}
185204
186-
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
187206
188-
Add your required files and folders under the `wwwroot\Files` directory.
207+
Add the Syncfusion Blazor FileManager component in `~/Pages/Index.razor` file.
189208
209+
{% tabs %}
210+
{% highlight razor %}
211+
212+
<SfFileManager TValue="FileManagerDirectoryContent">
213+
<FileManagerAjaxSettings Url="/api/FileManager/FileOperations"
214+
UploadUrl="/api/FileManager/Upload"
215+
DownloadUrl="/api/FileManager/Download"
216+
GetImageUrl="/api/FileManager/GetImage">
217+
</FileManagerAjaxSettings>
218+
</SfFileManager>
219+
220+
{% endhighlight %}
221+
{% endtabs %}
222+
223+
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.
190226
* 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.
191227
192228
![Blazor FileManager Component](images/blazor-filemanager-component.png)

blazor/file-manager/getting-started-with-web-app.md

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,29 @@ Add the Syncfusion Blazor FileManager component in `.razor` file inside the `Pag
106106
{% endhighlight %}
107107
{% endtabs %}
108108

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+
109128
## Initialize the service in controller
110129
111130
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.
114132
115133
{% tabs %}
116134
{% highlight cs tabtitle="Controllers/FileManagerController.cs" %}
@@ -125,7 +143,7 @@ using Microsoft.AspNetCore.Http.Features;
125143
using Syncfusion.EJ2.FileManager.Base;
126144
//File Manager's operations are available in the below namespace.
127145
using Syncfusion.EJ2.FileManager.PhysicalFileProvider;
128-
using Newtonsoft.Json;
146+
using System.IO;
129147
using System.Linq;
130148
using System.Threading.Tasks;
131149
@@ -185,7 +203,7 @@ namespace filemanager.Server.Controllers
185203
{% endhighlight %}
186204
{% endtabs %}
187205
188-
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:
189207
190208
```cshtml
191209
@@ -200,10 +218,50 @@ app.MapControllers();.
200218

201219
This will configure and map the controller in your Blazor App.
202220

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.
224+
225+
{% tabs %}
226+
{% highlight razor %}
227+
228+
<SfFileManager TValue="FileManagerDirectoryContent">
229+
<FileManagerAjaxSettings Url="/api/FileManager/FileOperations"
230+
UploadUrl="/api/FileManager/Upload"
231+
DownloadUrl="/api/FileManager/Download"
232+
GetImageUrl="/api/FileManager/GetImage">
233+
</FileManagerAjaxSettings>
234+
</SfFileManager>
235+
236+
{% endhighlight %}
237+
{% endtabs %}
238+
239+
## Interactive Modes to be Chosen
240+
241+
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 %}
204260

205261
Add your required files and folders under the `wwwroot\Files` directory.
206262

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.
207265
* 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.
208266

209267
![Blazor FileManager Component](images/blazor-filemanager-component.png)

0 commit comments

Comments
 (0)