Posted 05 Apr 2013 Link to this post
function
AllowJPEGExtension() {
var
upload = $find(
"<%= RadAsyncUpload1.ClientID %>"
);
if
(!upload.isExtensionValid(
".jpeg"
))
{
exts = upload.get_allowedFileExtensions();
exts[exts.length] =
;
}
Posted 09 Apr 2013 Link to this post
<
asp:RadioButtonList
ID
=
"RadioButtonList1"
runat
"server"
RepeatDirection
"Horizontal"
AutoPostBack
"true"
OnSelectedIndexChanged
"RadioButtonList1_SelectedIndexChanged"
>
asp:ListItem
Text
"jpg"
></
"doc"
"pdf"
</
br
/>
telerik:RadAsyncUpload
"RadAsyncUpload1"
protected
void
RadioButtonList1_SelectedIndexChanged(
object
sender, EventArgs e)
string
file = RadioButtonList1.SelectedItem.Text;
RadAsyncUpload1.AllowedFileExtensions =
new
[] {file};
Posted 14 Apr 2013 Link to this post
Posted 17 Apr 2013 Link to this post
RadAsyncUpload does not support such client change in the allowed extensions because it would cause a security by providing possibility to upload unwanted files. In your scenario since you only want to control this behavior with radio button instead of using the "AllowedFileExtensions" you can use OnClientFileUploading event and cancel the uploading file if its extension is not the desired one as in the code below:
OnClientFileUploading(sender, args) {
fileExtention = args.get_fileName().substring(args.get_fileName().lastIndexOf(
'.'
) + 1, args.get_fileName().length);
alert(fileExtention);
Posted 22 Apr 2013 Link to this post
I already did this. Thank you very much for your concern with Telerik controls.