[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 170
  • Last Modified:

identify the file type

i need to create web page  (in asp.net and c# 2.0) that lets the user upload files and sorts them into the following broad categories (a)audio (b)video (c)document (d)any other file.

i require implementation appraoch for the sorting logic. can anyone help? thanks
0
vkkconsul
Asked:
vkkconsul
  • 2
1 Solution
 
dinomixCommented:
Create an array with all the file types you support and concatenate a category to each one, example:
mp3a
wava
movb
qtvb
docc
xlsc
Then loop through and find a match based on extention and use the last character to map to a category.
0
 
vkkconsulAuthor Commented:
i appreciate the suggestion to use file type method. i am wondering is there any inherent feature of .net that provides this kind of clasification (thru tags/attributes etc.).  
0
 
dinomixCommented:
There is none i know of, file extentions indicate the file type, there is no categorization of extentions present inherently in windows or .net that i am aware of. This is a custom grouping and you would need to code the different groups.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now