Oh I thought you were talking about a bug with client-side events.
There are 3 server-side events for FileUploader component:
fileUploader.Uploading += FileUploaderUploading;
fileUploader.Uploaded += FileUploaderUploaded;
fileUploader.Failed += FileUploaderFailed;
private static void FileUploaderUploading(object sender, FileUploaderReceivingEventArgs e)
{
//You can iterate through e.Validationsproperty for all files that are about to be uploaded in a group
}
private static void FileUploaderUploaded(object sender, FileUploaderReceivedEventArgs e)
{
//You can iterate through e.Items property for all files uploaded in a group
}
private static void FileUploaderFailed(object sender, FileUploaderFailedEventArgs e)
{
}
Refer to docs for all properties in the related eventArgs:
There are also 5 client-side events:
@using GleamTech.AspNet.Core
@using GleamTech.FileUltimate.AspNet.UI
<!DOCTYPE html>
@{
var fileUploader = new FileUploader
{
Width = 600,
Height = 300,
Resizable = true,
UploadLocation = "~/App_Data/Uploads",
ClientEvents = new FileUploaderClientEvents
{
ItemUploaded = "genericEventHandler"
}
};
}
<html>
<head>
<title>File Uploader</title>
@this.RenderHead(fileUploader)
<script type="text/javascript">
function genericEventHandler(sender, e) {
//Pretty print the chosen info (from event object)
var json = JSON.stringify(e, null, 2);
//alert(json);
console.log(json);
}
</script>
</head>
<body>
@this.RenderBody(fileUploader)
</body>
</html>
Sample output in console:
{
"eventName": "uploaded",
"items": [
{
"itemType": "File",
"name": "Spotlight 1.jpg",
"nameWithoutPath": "Spotlight 1.jpg",
"extension": "jpg",
"dateModified": "2015-12-29T10:24:48.512Z",
"type": "JPG File",
"size": 1791421,
"status": "Completed"
},
{
"itemType": "File",
"name": "New folder\\Screen 1.jpg",
"nameWithoutPath": "Screen 1.jpg",
"extension": "jpg",
"dateModified": "2015-10-30T07:18:39.768Z",
"type": "JPG File",
"size": 1557291,
"status": "Completed"
}
],
"uploadMethod": "Html5",
"uploadMethodFeatures": {
"selectFile": true,
"selectMultiple": true,
"selectFolder": true,
"dragAndDrop": true,
"displayThumbnails": true,
"sendAsChunks": true,
"sendAsMultipart": true,
"reportProgress": true,
"reportFileSize": true,
"reportFileDate": true
}
}