In the context of the development of my website MySpector.com developed with Blazor Server, I want to give the user the possibility to download files which are stored on the disk of the machine. To do this I want to create a Blazor Component / Page ( I do not know what) which will:
- take as input a database ID,
- fetch the database to locate the file in disk
- dynamically transfer the data to be downloaded to the webbrowser
I am having problem to understand how I can program the http response headers and content with Blazor. I have seen a potential solution on Blazor download on microsoft but I do not like the idea to create a RAZOR page inside a BLAZOR solution, as this introduce a component organized in a different way than the other ( 2 files: .cshtml + .cshtml.cs, instead of 1 .razor file)
see below Downloader.cshtml in the file hierarchy which looks like different than the other pages.
I am also aware of the 'different layers' of blazor server where a page is only a subpart of a bigger html context so I see the problem, but I woudl like to find a easy way only to override http GET via a .razor single file... if this is possible.
Regards.