From 224cc54d67769979bda81cf5a17924cf6634d24f Mon Sep 17 00:00:00 2001 From: Jonathanshrek Date: Tue, 13 Sep 2022 23:12:22 -0400 Subject: [PATCH] Altered README to increase understanding of how to implement. --- README.md | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 6bdd179..fa74869 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Blazor download files to the browser from c# without any JavaScript library or dependency. -BlazorDownloadFile is the solution to saving files on the client-side, and is perfect for web apps that generates files on the client. +BlazorDownloadFile is the solution to saving files on the client-side, and is perfect for web apps that generates files on the client. However if the file is coming from the server we recommend you to first try to use Content-Disposition attachment response header as it has more cross-browser compatibility. @@ -23,13 +23,13 @@ However if the file is coming from the server we recommend you to first try to u ## Register the service in your services method -`services.AddBlazorDownloadFile(ServiceLifetime lifetime = ServiceLifetime.Scoped);` +`builder.Services.AddBlazorDownloadFile();` Note: `ServiceLifetime.Singleton` is not supported. ## No javascript library reference dependency unless... -## If you are using Content-Security-Policy "script-src 'self'" then you need to add the script manually: +## If you are using Content-Security-Policy "script-src 'self'" then you need to add the script manually: ###