Greetings!!
I am trying to count total numbers of files have been selected or dropped in file dropbox in AjaxFileUpload controller. It shows on number of files in Queue. I need to access the numbers of files in queue. How could I do that. I am trying to write onchange event for AjaxFileUpload but it's not working which works for ASP File Uploder.
It will be helpful if I get the number of files have been selected on AjaxFileUpload change.
Thanks
You can count
number of file uploaded successfully from JavaScript
by using OnClientUploadComplete
event. Please check below:
AjaxFileUpload Code:
<ajaxToolkit:AjaxFileUpload ID="AjaxFileUpload1" OnClientUploadComplete="uploadcomplete" OnUploadComplete="AjaxFileUpload1_UploadComplete" Mode="Auto" runat="server" />
JavaScript Ccode:
<script type="text/javascript">
var totalUploaded = 0;
function uploadcomplete()
{
totalUploaded += 1;
}
</script>
For more details about this, please check AJAX Control Toolkit Tutorial: AjaxFileUpload.
As for my understanding: AjaxFileUpload.js library doesn't support multiple uploads by itself. So you have to implement the multi-file upload by yourself. There are others libraries that support multiple files upload out of the box: Fine Uploader 5 seen to be a nice one.
If you need to use AjaxFileUpload you can follow this stackoverflow question that is related of what you want to do upload multiple files with ajaxFileUpload with different file ids . Then you can add a counter for as many times as you call the function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With