Register a domain and help support LQ
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-26-2004, 01:09 PM   #1
Registered: Sep 2003
Location: Chicago
Distribution: Slackware 13 x86_64
Posts: 58

Rep: Reputation: 15
CGI in C: need help determining mime types of files

hello everyone,

I've got a mind bug i cant seem to figure out.. i'm trying to determine mime type of any file (the cgi takes a filename as an argument, makes sure all the "download slots" aren't being used and then sends the file out), reads it, and spews it out. However, i'm sending out
printf("Content-Type: null/null\n\n");
i've been scouring the man pages and the internet for routines that do this for me, i had read that gnome had something like "gnome_mime_type(file)", but appearantly it's not installed on my system... Any ideas?
Old 01-26-2004, 11:55 PM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 658Reputation: 658Reputation: 658Reputation: 658Reputation: 658Reputation: 658
Maybe you could use system() to run the file --mime command.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
cups, mime.types and mr.wobble Linux - Networking 2 05-29-2006 11:44 PM
Adobe Acrobat, mime-types and pdf files positrox Linux - Software 1 12-01-2005 07:31 AM
mime types Nightfrost Linux - General 2 10-01-2004 06:11 AM
Determining MIME Type of a File Jose Muņiz Linux - General 2 08-16-2004 02:44 AM
MIME Types? JoeLinux Linux - Software 6 09-14-2002 05:54 AM

All times are GMT -5. The time now is 09:28 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration