|
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
|
|
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
|
|
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?
|
|
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
|
|
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
|
|
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.
|
|
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!
|
|
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
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
You are very welcome. Glad that it works for you!
|
|