Welcome Guest Search | Active Topics | Sign In | Register

AJAX Uploader -- how to detect file selection? Options
Fabio
Posted: Wednesday, March 2, 2016 9:57:25 AM
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
eo_support
Posted: Wednesday, March 2, 2016 2:58:20 PM
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!
eo_support
Posted: Monday, March 7, 2016 11:46:37 AM
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!
Fabio
Posted: Tuesday, March 8, 2016 9:58:43 AM
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.
eo_support
Posted: Saturday, March 12, 2016 9:04:16 PM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.