Welcome Guest Search | Active Topics | Sign In | Register

Ajax Uploader file type Options
minibigboss
Posted: Thursday, September 16, 2010 9:41:51 AM
Rank: Newbie
Groups: Member

Joined: 7/31/2010
Posts: 4
hello
i'm having a problem with limiting the file types allowed for teh ajax uploader
now i write au1.AllowedExtension=".pdf|.doc"
and it appears to be working properly... it does not allow any other type
however
the browse file and select dialog shows All Files(*.*)

is there a way to change that as well?

thanks
eo_support
Posted: Thursday, September 16, 2010 9:45:52 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Unfortunately there is no way to change that. You will have to use Plug-in based solution such as ActiveX or Adobe Flash based components for that.

Thanks
minibigboss
Posted: Thursday, September 16, 2010 9:48:26 AM
Rank: Newbie
Groups: Member

Joined: 7/31/2010
Posts: 4
thanks for the quick reply
how about to show an alert box with a message in that case?
is there anything i can do for that?
eo_support
Posted: Thursday, September 16, 2010 9:54:02 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Do you mean to show something like "The uploader only takes .pdf or .doc file, but you have selected a .txt file" if user selected a file that won't be accepted? I believe that is technically possible but we will need to change our code to do that.

Thanks
minibigboss
Posted: Thursday, September 16, 2010 10:01:08 AM
Rank: Newbie
Groups: Member

Joined: 7/31/2010
Posts: 4
yes exactly thats what i want
i mean we already have a limit from asp.net to limit the filetypes to be shown
so an informative message would be a great idea
i was so happy to see the allowedextension property
but with the message box that would be great
eo_support
Posted: Thursday, September 16, 2010 10:04:01 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
I see. We will look into it and see if we can add that. We will post again once we have an update.
eo_support
Posted: Friday, September 17, 2010 4:42:35 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We have posted a new build should addressed this issue. The new build would display an error message immediately and clear the input box when the selected file has an invalid extension. Please see your private message for the download location.

Note that the default message is not very user friendly. However you can handle the uploader's ClientSideOnError handler to provide your own message text. It will be something like this:

Code: HTML/ASPX
<eo:AJAXUploader ClientSideOnError="error_handler" ...>
...
</eo:AJAXUploader>


Code: JavaScript
function error_handler(control, error, message)
{
    if (error == "extension_not_allowed")
    {
        //display your own error message....
        .....
    }
    else
    {
        //display the default message
        alert(message);
    }
}


Please let us know if you have any questions.

Thanks!
minibigboss
Posted: Friday, September 17, 2010 5:17:55 PM
Rank: Newbie
Groups: Member

Joined: 7/31/2010
Posts: 4
Excellent!!! Exactly what I needed!
Tested it and it's working great.

Thank you very very much! :D
eo_support
Posted: Friday, September 17, 2010 5:19:19 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
You are very welcome. Glad that it works for you!


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.