Ok, a teacher I know wanted me to create a document manager. I figured the easiest way on both here and myself was to have it check directories for files and display them. My question is that when I am getting the file name, is there an easy way to find out what type of file it is (as in PDF, DOC, GIF, etc), so I can display an nice little image for people to see (as, most people who will be using it won't know the difference between any file type).
read all characters after the last period, or use mime_content_type()

Either way can be fooled, but it's a start.
well, I don't expect my teacher to try and fool that stuff (she is not that smart).
yeah. mime_content_type() in php is useful... it'll give you like "image/gif" etc... you can use those, right?
I'd say to go with mime_content_type() if I were you.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement