Help answer threads with 0 replies.
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, 12:09 PM   #1
Registered: Sep 2003
Location: Chicago
Distribution: Slackware-current
Posts: 63

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, 10:55 PM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
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 10:44 PM
Adobe Acrobat, mime-types and pdf files positrox Linux - Software 1 12-01-2005 06:31 AM
mime types Nightfrost Linux - General 2 10-01-2004 05:11 AM
Determining MIME Type of a File Jose Muņiz Linux - General 2 08-16-2004 01:44 AM
MIME Types? JoeLinux Linux - Software 6 09-14-2002 04:54 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:53 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
Open Source Consulting | Domain Registration