The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
<drive type unknown> when format command run prvnrk SUN Solaris 1 09-08-2007 07:56 AM
Command that prints content of line5, or similar? lunchtime Linux 4 07-09-2007 05:58 AM
Type of content: VENDOR WHITE PAPER - Forbes iBot UNIX and Linux RSS News 0 07-04-2007 01:00 AM
Command to determine Tape Type Surdeymon AIX 4 06-10-2005 10:19 AM
Content-Type primal UNIX for Dummies Questions & Answers 1 12-20-2001 09:36 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 11-19-2005
Registered User
 

Join Date: Nov 2005
Posts: 2
Can i change content type?

Hi
I run on a Unix webserver at my university. I have a couple of *.inc files which are include files used for php.

They are all in one folder without an index file. If you go to the folder, you get to see a list of files in that dir.

Some of the .inc have a question mark icon next to it. others have a text icon next to it. I do not know why? They are the same extensions.

All have html tags inside. If you go to each one in a web browser, some files will display as html by the browser. others will display it as text.

Is there a reason behind this due to content type? if so, how do i change it?
Also, i connect using telnet or SSH. if i run ls, some files have an asterisk next to the name. Why is that?

Last edited by aqh2; 11-19-2005 at 09:53 AM.
Reply With Quote
Forum Sponsor
  #2  
Old 11-19-2005
Moderator
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,469
Your school's Apache probably have mod_mime_magic enabled.

Apache's usual way to determine the icon used on an directory index is by the MIME type of the file (a few others by name). In turn, MIME type are defined by extension (either from AddType directives or mime.types as system default). So the way the icon is determined should be relatively "consistent".

If mime-magic is enabled, it will try to scan the first few bytes of the file in question, in the same way you do it with a file(1) command to determine the type. It matches according to a set of preset signature in a magic file. So, extension is not important if this extension is enabled, so multiple files with same extension may come up with different icons, depending on what is contained in the first few bytes of the file.
Reply With Quote
  #3  
Old 11-19-2005
Registered User
 

Join Date: Nov 2005
Posts: 2
Thanks for the answer,
Now i need to know if there is a unix command that i can run that could manually change the mime-type of the file.

The other question is why is there an asterisk next to the filename.
Reply With Quote
  #4  
Old 11-19-2005
Moderator
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,469
Quote:
Originally Posted by aqh2
Thanks for the answer,
Now i need to know if there is a unix command that i can run that could manually change the mime-type of the file.
You just change the configuration files in Apache to affect Apache. I see no reason to change the system magic file signature as the two are separate.

Please search the Web for more information about this, in particular look for the keywords I used in the previous post.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:23 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0