Class BeforeDownloadEventArgs<TValue>
Represents the class for BeforeDownload event arguments.
Inheritance
Namespace: Syncfusion.Blazor.FileManager
Assembly: Syncfusion.Blazor.dll
Syntax
public class BeforeDownloadEventArgs<TValue> : Object
Type Parameters
Name | Description |
---|---|
TValue | Specifies the TValue of the FileManager. |
Remarks
The Download operation is handled by using form submit and not by using Http request, so it is not possible to pass the HttpClientInstance here. However, you can send custom values from client to server for Download operation by preventing our default download operation using args.Cancel in BeforeDownload event. Then you can trigger the customized download operation using an interop call where you can pass custom values to server side.
Constructors
BeforeDownloadEventArgs()
Declaration
public BeforeDownloadEventArgs()
Properties
Cancel
'true' if the download operation must be cancelled. Otherwise,false.
Declaration
public bool Cancel { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
This allows the users to cancel the download of specific files or folders in required cases.
DownloadData
Gets or sets the data to be sent to the server when downloading files from the FileManager.
Declaration
public DownloadData<TValue> DownloadData { get; set; }
Property Value
Type |
---|
DownloadData<TValue> |
Remarks
The DownloadData<TValue> class encapsulates the data required to perform a download operation on the FileManager. This property should be set to an instance of the DownloadData<TValue> class that specifies the file(s) to be downloaded, as well as any additional parameters that may be required by the server. When this property is set, the FileManager will send a request to the server to initiate the download. The server should respond with the requested file(s) in the appropriate format (e.g., as a byte array or as a file stream). The FileManager will then download the file(s) and provide them to the user for download.
DownloadFileName
Gets or sets the file name to be downloaded from the server.
Declaration
public string DownloadFileName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The file name to be downloaded. |
Remarks
The users can pass the file name to be downloaded from the server.
FileStream
Gets or sets the file stream to be downloaded from the server.
Declaration
public Stream FileStream { get; set; }
Property Value
Type | Description |
---|---|
System.IO.Stream | The file stream to download. |
Remarks
The users can pass the file stream to be downloaded from the server.
HttpClientInstance
Gets or sets the HttpClient instance through which http request for the file providers are sent.
Declaration
public HttpClient HttpClientInstance { get; set; }
Property Value
Type |
---|
System.Net.Http.HttpClient |
Remarks
The users can pass the required JWT token or authentication token with this instance.
UseFormPost
Gets or sets a value whether the download perform through form submit method or using HTTP client instance.
Declaration
public bool UseFormPost { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true perform download operation using form submit method; otherwise perform download using HTTP client instance, false. The default value is true. |