LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   CGI in C: need help determining mime types of files (https://www.linuxquestions.org/questions/programming-9/cgi-in-c-need-help-determining-mime-types-of-files-138862/)

Sm0k3 01-26-2004 12:09 PM

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
Code:

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?

jschiwal 01-26-2004 10:55 PM

Maybe you could use system() to run the file --mime command.


All times are GMT -5. The time now is 05:49 PM.