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

isExtensionValid is not precise

1 Answer 72 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
ManniAT
Top achievements
Rank 2
ManniAT asked on 27 Apr 2009, 09:23 PM
Hi,

I messed around a few hours today why my uploaded file is always under InvalidFiles.
My Client validation (from help) looks like this:
function validateRadUpload(source, e)  
{  
   e.IsValid = false;  
 
   var upload = $find("<%= rulThumb.ClientID %>");  
   var inputs = upload.getFileInputs();  
   for (var i = 0; i < inputs.length; i++)  
   {  
       //check for empty string or invalid extension  
       if (inputs[i].value != "" && upload.isExtensionValid(inputs[i].value))  
       {  
           e.IsValid = true;  
           break;  
       }      
   }  
}  
 
My AllowedFileExtensions was set to "jpg,gif,png".
So my client always tells me OK - but on the server I get the file in InvalidFiles.
I took a look at a lot of things - but not on the extensions - because they are OK - told me the isExtensionValid :)
The problem (you telerik guys know my error) was with AllowedFileExtensions - the must be ".jpg,.gif,.png" - so it was the dot I've been missing.

So far so good; my fault - but isExetensionValid should check in the same way as the "server validation" does I guess!

Regards

Manfred

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 01 May 2009, 07:22 AM
Hi ManniAT,

Yes, you are right. We will fix the problem and it will be included in the latest internal builds next week.

Thank you.

Best wishes,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Upload (Obsolete)
Asked by
ManniAT
Top achievements
Rank 2
Answers by
Veselin Vasilev
Telerik team
Share this question
or