Hello. I'm trying to build a website which should accept uploaded files. My question is: how do you retrieve the filetype of uploaded files?

Too many ways to figure this out.

  1. Take the file extension fo its word. MP3 is MP3, JPEG is JPEG, etc.
  2. Consider the Linux file command. https://man7.org/linux/man-pages/man1/file.1.html
  3. "files don't really have types." so you get to define what you are asking further.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.