IFileInputSelectedFile.LastModified Property
Returns the file’s last modified date.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
long LastModified { get; }
Property Value
Type | Description |
---|---|
Int64 | The number of ticks that corresponds to the date and time when the file was last modified. |
Remarks
The LastModified
property returns the number of ticks that corresponds to the date and time when the file was last modified. For files with an unknown last modified date, the property returns the number of ticks that corresponds to the current date.
The following example gets last modified dates of uploaded files:
<DxFileInput FilesUploading="OnFilesUploading" />
@code {
async Task OnFilesUploading(FilesUploadingEventArgs args) {
foreach (var file in args.Files) {
var lastModified = file.LastModified;
// ...
/* The following code is intended for demonstration purposes only.
Do not read a stream directly in memory to avoid performance and security-related issues. */
using var stream = new System.IO.MemoryStream();
await file.OpenReadStream(file.Size).CopyToAsync(stream);
}
}
}
See Also