From the course: Advanced Blazor WebAssembly
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Security with file upload through Blazor WebAssembly
From the course: Advanced Blazor WebAssembly
Security with file upload through Blazor WebAssembly
- [Instructor] It's good if an uploaded file can be validated before it even reaches the ASP.NET Core app. That means that any potential malicious files won't reach the server if they do not pass validation. As Blazor WebAssembly is a .NET framework, it means it can share code between itself and an ASP.NET Core app through a shared class library. One code block can be written and shared across multiple .NET applications. This gives it an advantage over JavaScript frameworks, such as Angular and React, where a separate validation script would need to be coded using JavaScript. A good example of this is validating a file when it is being uploaded. The Blazor WebAssembly app can validate the file first and only upload it to the ASP.NET Core app if it passes the test. From there, the ASP.NET Core app can run the same validation to ensure that the file validates before adding it to its file storage. The…