I have
<ejs-uploader id="UploadFiles" dropArea=".control-fluid" actionComplete="onComplete" success="onSuccess" asyncSettings="@asyncSettings" autoUpload="false" buttons="@uploadBottuns">
User clicks a button and the files are sent using:
let uploadFiles = document.getElementById('UploadFiles').ej2_instances[0];
uploadFiles.upload(uploadFiles.getFilesData());
uploadFiles.clearAll();
And I would like to know when the files upload is finished.
The onComplete and onSuccess methods are not called.
The files are sent correctly.
I need to know when the upload of all files finished.
Hi Karol Zynda,
Thank you for reaching out to us regarding your concerns with file uploads using the uploader component.
Regarding your first query about checking if the files have already been sent, the uploader component inherently prevents duplicate file uploads by default. Therefore, there's no need to manually check whether the file has already been sent or not.
For your second query, to track when all files have finished uploading, you can utilize the "success" event to track each file's successful upload, or the "actionComplete" event to know when all files have completed uploading. However, you mentioned that both events were not triggered at your end. We have thoroughly tested these events, and they are triggering properly. To assist you better, we have attached a sample code snippet below:
|
<ejs-uploader id="UploadFiles" dropArea=".control-fluid" actionComplete="onComplete" success="onSuccess" asyncSettings="@asyncSettings" autoUpload="false"></ejs-uploader>
function onComplete(args){ // The actionComplete event triggers once all files are uploaded } function onSuccess(args) { // The success event triggers for each file that gets uploaded successfully. }
</script>
|
Please ensure that your implementation aligns with the provided sample code. If you're still encountering issues, kindly provide us with a replication sample of your problem so that we can offer you a prompt solution.
Feel free to reach out to us if you need any further assistance.
Hi,
Thanks fory replay.
actionComplete is triggered when I use standard(from control) upload button. But when I upload from code, actionComplete doesn't work.
Hi Karol Zynda,
Thank you for bringing this to our attention.
We've thoroughly reviewed your query and prepared a sample based on your scenario. Upon testing, we couldn't replicate the issue at our end. When we uploaded files programmatically through a button click event, the action complete event was triggered properly.
To assist you further, could you provide a sample that replicates the issue you're experiencing? Alternatively, you can modify the shared sample for better understanding. Your cooperation is greatly appreciated.
For more information, you can refer to our documentation: Uploader Documentation.
Please feel free to watch the video illustration for additional insights.
Looking forward to your response.
I cannot add video, so I zipped and atached as zip.
As you can see, in my code onSuccess doesn't call.
Attachment: bandicam_20240222_141717655_2d2d2c81.zip
But the files are uploaded to the server correctly
Video Illustration: 186822_abc44de3.zip