This is a migrated thread and some comments may be shown as answers.

Client validation failed?

3 Answers 94 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 12 Nov 2014, 04:34 PM
Hi all,
   Could someone help me with this issue...  I'm wanting to code the AllowedFileExtensions on the server side or make it dymanic...

Code behind:
radAsyncUpload1.AllowedFileExtensions = "doc.docx,pdf.xls".Split(',');

doesn't seem to be working and it fails on the client end.

But when I it's in the control like this it work...

<telerik:RadAsyncUpload ID="radAsyncUpload1" runat="server" AllowedFileExtensions="doc,docx,pdf,xls" />

based on this http://demos.telerik.com/aspnet-ajax/asyncupload/examples/validation/defaultcs.aspx.

3 Answers, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 17 Nov 2014, 01:45 PM
Hi Paul,

The AllowedFileExtensions property accepts array of strings:

protected void Page_Load(object sender, EventArgs e)
    {
        RadAsyncUpload1.AllowedFileExtensions = new string[] {".jpg",".png,", ".bmp" };
}

I hope this helps.


Regards,
Hristo Valyavicharski
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Paul
Top achievements
Rank 1
answered on 19 Nov 2014, 04:05 PM
I'm still not sure this won't work...

So what the difference between this "doc,docx,pdf,xls".Split(',')?

--- OR  if I have it in the web.config ---
  <appSettings>
    <add key="FileExtension" value="doc,docx,pdf,xls"/>
  </appSettings>

code behind...
            string[] allowedExt = ConfigurationManager.AppSettings["FileExtension"].Split(',');
            radAsyncUpload1.AllowedFileExtensions = allowedExt;

This that not the same thing? If it is why isn't it working...
0
Hristo Valyavicharski
Telerik team
answered on 24 Nov 2014, 12:13 PM
It is the same. Should be working:

http://screencast.com/t/chtGxxGG

Regards,
Hristo Valyavicharski
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
AsyncUpload
Asked by
Paul
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Paul
Top achievements
Rank 1
Share this question
or