SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot xPox's Avatar
    Join Date
    Sep 2005
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Detecting file types

    I'm creating a table populated by all the files in a user's folder. I can use getimagesize() to get file types for image files, but how can I get the format or mime/type for all other files (e.g. .XLS, .DOC, .TXT, .MPG...)

  2. #2
    Colonel Jack O'neill Josh_'s Avatar
    Join Date
    Apr 2004
    Location
    NC
    Posts
    689
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If all you want is the type of file, you can use explode() and explode it at the period

  3. #3
    SitePoint Zealot xPox's Avatar
    Join Date
    Sep 2005
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I need the mime type, not the extension. Several files can have the same extension, but use a different mime type.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •