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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -