c# - How to get file type in file upload control? -
i used in file upload control. got file name createdatabase.docx
. want filetype
docx
i have createdatabase.docx
.i want file type or want remove createdatabase
i have lot of file xml,pdf,docx,etc . .so i want file type or next characters of dot(.)
you can use
system.io.path.getextension(fileupload1.filename)
or can perform
string[] segments= fileupload1.filename.split("."); string fileext = segments[segments.length-1]
Comments
Post a Comment