Surya sasidhar Surya sasidhar - 1 year ago 102
ASP.NET (C#) Question

How to find extension of a file?

in my web application (,c#) i am uploading video file in a page but i want to upload only flv videos. how can i restrict when i upload other extension videos help me please.

Answer Source


string myFilePath = @"C:\MyFile.txt";
string ext = Path.GetExtension(myFilePath);
// ext would be ".txt"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download