LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 01-26-2004, 12:09 PM   #1
Sm0k3
Member
 
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
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?
 
Old 01-26-2004, 10:55 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

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


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:46 AM.

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