|
Rank: Member Groups: Member
Joined: 1/9/2008 Posts: 27
|
Hi,
I couldn't find any way to detect when a file has been selected (or changed) in AJAX uploader. I tried using jQuery to attach a listener to change event on the file input, but it looks like it gets cleared sometimes.
I am inserting an error message into the page when a file with incorrect extension is selected. I want to remove this message when correct file is selected. Can you help with any suggestions?
Thanks, Artem
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
There is no way to do that now. We do keep checking the file names internally. So it is possible for us to add this. We will look into this and see what we can do
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, We have posted a new build (2016.0.17.0) that added ClientSideOnFileSelected event to the AJAXUploader control. You can use it this way:
Code: JavaScript
function on_file_selected(uploader, files)
{
//files contains an array of all selected files (in case you have
//multiple rows in the uploader control). You can check the
//values in files array and if they are not acceptable to you,
//you can return false from this function. This will clear all
//input values
}
Code: HTML/ASPX
<eo:AJAXUploader ClientSideOnFileSelected="on_file_selected" .... >
....
</eo:AJAXUploader>
Hope this will be useful to you. Please let us know if you still have any questions. Thanks!
|
|
Rank: Member Groups: Member
Joined: 1/9/2008 Posts: 27
|
Hi, I have tested the new build. New event handler is certainly helpful but in certain scenarios it's not working. E.g. I set AllowedExtension=".zip" on the uploader and select a non-zip file. ClientSideOnError fires as expected and I show a validation message. After that when a zip file is selected ClientSideOnFileSelected does not fire.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
Please download build 2016.0.21.0 from our download page. This build fixed this issue.
Thanks!
|
|