Skip to content

Blazor File Downloads Documentation #30736

@berets76

Description

@berets76

Hi, looking around for the answer to the question "how to download a file with blazor server", several approaches are suggested, but it's not clear what the best solution is.

I found samples using controller, razor page, javascript interop, and some others hacks.

Is there a best practice regarding this topic ?

In the specific case, if I've a PDF file (but it could be anything else) content as byte[], what is the officially recommended method to generate a download in the browser ?

Thanks

Metadata

Metadata

Assignees

Labels

DocsThis issue tracks updating documentationDoneThis issue has been fixedarea-blazorIncludes: Blazor, Razor Componentsfeature-blazor-builtin-componentsFeatures related to the built in components we ship or could ship in the future

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions