Sponsored Content
Full Discussion: Retrieving File's Mime-type
Top Forums Shell Programming and Scripting Retrieving File's Mime-type Post 302273093 by jim mcnamara on Friday 2nd of January 2009 03:57:20 PM
Old 01-02-2009
If you have the .pm file for mime type checking (for example like Lite.pm for mime::lite)
you do not necessarily have to "install" the module. Just put it in your directory on the machine you are using, say /home/Rhije/Lite.pm

and add this to the shebang in the top of your own perl code
Code:
#!/bin/perl -I/home/Rhije/Lite.pm

This may not always work, but mime content-type checking is reasonably complex, so it is definitely worth a try. Rather than rolling your own. You can pack the two files in a tarball, extract them and run the perl. I know it violates your "one file" request.
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

retrieving a deleted file

hi!, is there any way to retrieve a file that I have deleted few minutes back?? I am using Solaris- 5.6.. :rolleyes: (2 Replies)
Discussion started by: jyotipg
2 Replies

2. UNIX for Advanced & Expert Users

How to Set Mime type to mailx

I have a problem while sending attachement , it is displying Content into body of mail (Junk Data) instead of attachment (zip format) in Linux, same code is working in Sun Solaris.. I have read query in this site , need to set MIME type to mailx componment. Please help me how to set MIME type..... (1 Reply)
Discussion started by: suneel
1 Replies

3. UNIX for Dummies Questions & Answers

Lynx - Downloading - extension handling - changing mime type?

Using Lynx, when I try to download a .rar, it confirms I want to download and its got it as an appication/rar file. However, split archives that end in .r## (.r00, .r01 ...) are not recognized as an appication/rar file and it reads the file like a .txt or .html. How can I fix this? Thanks! (2 Replies)
Discussion started by: yitzle
2 Replies

4. UNIX for Dummies Questions & Answers

Retrieving PID from a file

Hello I need to retrieve the content of a file in the shell script file(.sh file). I store the Process ID of the a process in file.Only the PID is available in that file. Inside the shell script i want to retireve the content(PID) and need to check for the existence of the Process.Basically... (5 Replies)
Discussion started by: appleforme1415
5 Replies

5. HP-UX

How to attach an excel file in a multipart (mime) mail

Hello. I need to send mails from hp-ux with 2 attachments: a text file and an excel file. So I'm composing a mime file which I will pipe to sendmail utility. This works fine if the only attachment is the text file (i use cat command to attach text content). But I have problems with the format... (3 Replies)
Discussion started by: elcampio
3 Replies

6. Shell Programming and Scripting

Retrieving File name

Hi All.. I have a Filename as FAB1_600015_CONRAD.A0_7XYZ12345.000_LT-SWET.01_LTPA25L_20110622-161429_07_WFR12345_20110622-161429_20110712-125228.data.dis I want to get the result as... (5 Replies)
Discussion started by: asheshrocky
5 Replies

7. Shell Programming and Scripting

MIME Type detection for Net::SMTP

I've spent a good two weeks on trying to figure out a proper way to get the mime type of a file. The "file" command on the Sparc machine I'm working on is an older version and does not support the --mime flag. It outputs things like: somefile.pdf: Adobe Portable Document Format (PDF) v1.5 ... (3 Replies)
Discussion started by: mrwatkin
3 Replies

8. UNIX for Beginners Questions & Answers

MIME type for sending gzip file as attachment in email

Hello, I am trying to send a gzip file on email using below command but the zipped file received on email is corrupt. mailsend -smtp $smtpip -content-type 'application/x-gzip' -mime-type "application/x-gzip" -t $receiver -f $sender -sub "$subject" -M "$MSG" -attach $file file name is ... (1 Reply)
Discussion started by: tushar.modgil
1 Replies
mime.convs(5)                                                       Apple Inc.                                                       mime.convs(5)

NAME
mime.convs - mime type conversion file for cups DESCRIPTION
The mime.convs file defines the filters that are available for converting files from one format to another. The standard filters support text, PDF, PostScript, HP-GL/2, and many types of image files. Additional filters can be added to the mime.convs file or (preferably) to other files in the CUPS configuration directory. Each line in the mime.convs file is a comment, blank, or filter line. Comment lines start with the # character. Filter lines specify the source and destination MIME types along with a relative cost associated with the filter and the filter to run: super/type super/type cost filter application/postscript application/vnd.cups-raster 50 pstoraster SEE ALSO
classes.conf(5), cupsd(8), cupsd.conf(5), mime.types(5), printers.conf(5), http://localhost:631/help COPYRIGHT
Copyright 2007-2011 by Apple Inc. 20 March 2006 CUPS mime.convs(5)
All times are GMT -4. The time now is 05:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy