Hello Everyone !
How can I set the non allowable file list in RadUpload. I will like to set up the blacklist file type and except of these blacklist I will allow to upload file .
How can I do these in radupload control ? I need your help Urgently .
Thanks ,
Tin
How can I set the non allowable file list in RadUpload. I will like to set up the blacklist file type and except of these blacklist I will allow to upload file .
How can I do these in radupload control ? I need your help Urgently .
Thanks ,
Tin
4 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 24 May 2012, 07:22 AM
Hi Tin,
I suppose that you want to allow only some file extensions for uploaded files. The AllowedFileExtensions property lists the valid file extensions for uploaded files. When the AllowedFileExtensions property is set, RadUpload automatically validates the extensions of selected files, moving any files with disallowed extensions to the InvalidFiles collection.
ASPX:
Hope this helps.
Thanks,
Princy.
I suppose that you want to allow only some file extensions for uploaded files. The AllowedFileExtensions property lists the valid file extensions for uploaded files. When the AllowedFileExtensions property is set, RadUpload automatically validates the extensions of selected files, moving any files with disallowed extensions to the InvalidFiles collection.
ASPX:
<
telerik:RadUpload
id
=
"RadUpload1"
runat
=
"server"
allowedfileextensions
=
".zip,.jpg,.jpeg"
/>
Hope this helps.
Thanks,
Princy.
0

Tin
Top achievements
Rank 1
answered on 24 May 2012, 07:29 AM
Hello Princy
Thanks for your reply .I already used what did you mention. However now I can't give the allowable file list . I want to give only invalid file list . So What can I do is use CustomValidator is it correct way ?Any the best solution ? Let me know ?
With BR,
Tin
Thanks for your reply .I already used what did you mention. However now I can't give the allowable file list . I want to give only invalid file list . So What can I do is use CustomValidator is it correct way ?Any the best solution ? Let me know ?
With BR,
Tin
0

Princy
Top achievements
Rank 2
answered on 24 May 2012, 10:30 AM
Hi Tin,
Try the following code snippet.
ASPX:
C#:
Hope this helps.
Thanks,
Princy.
Try the following code snippet.
ASPX:
<
telerik:RadUpload
ID
=
"RadUpload1"
runat
=
"server"
onvalidatingfile
=
"RadUpload1_ValidatingFile"
>
</
telerik:RadUpload
>
C#:
protected
void
RadUpload1_ValidatingFile(
object
sender, Telerik.Web.UI.Upload.ValidateFileEventArgs e)
{
UploadedFile file = e.UploadedFile;
if
( file.GetExtension() ==
".gif"
)
//can give the invalid file extensions
{
Response.Write(
"Invalid file"
);
e.IsValid =
false
;
}
}
Hope this helps.
Thanks,
Princy.
0

Tin
Top achievements
Rank 1
answered on 24 May 2012, 12:09 PM
Hello Princy ,
Thanks you so much for you help. It is help me .
Best Regards,
Tin.
Thanks you so much for you help. It is help me .
Best Regards,
Tin.