Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dancer::mime(3pm) [debian man page]

Dancer::MIME(3pm)					User Contributed Perl Documentation					 Dancer::MIME(3pm)

NAME
Dancer::MIME - Singleton object to handle MimeTypes SYNOPSIS
# retrieve object instance my $mime = Data::MIME->instance(); # return a hash reference of user defined types my $types = $mime->custom_types; # return the default mime-type for unknown files $mime->default # set the default mime-type with Dancer::Config or Dancer, like set default_mime_type => "text/plain"; # or directly in your config.yml file. # add non standard mime type $mime->add_type( foo => "text/foo" ); # add an alias to an existing type $mime->add_alias( bar => "foo" ); # get mime type for standard or non standard types $nonstandard_type = $mime->for_name('foo'); $standard_type = $mime->for_name('svg'); # get mime type for a file (given the extension) $mime_type = $mime->for_file("foo.bar"); PUBLIC API
instance my $mime = Dancer::MIME->instance(); return the Dancer::MIME instance object. add_type # add nonstandard mime type $mime->add_type( foo => "text/foo" ); Add a non standard mime type or overrides an existing one. add_alias # add alias to standard or previous alias $mime->add_alias( my_jpg => 'jpg' ); Adds an alias to an existing mime type. for_name $mime->for_name( 'jpg' ); Retrieve the mime type for a standard or non standard mime type. for_file $mime->for_file( 'file.jpg' ); Retrieve the mime type for a file, based on a file extension. custom_types my $types = $mime->custom_types; Retrieve the full hash table of added mime types. name_or_type my $type = $mime->name_or_type($thing); Resolves the $thing into a content $type whether it's the name of a MIME type like "txt" or already a mime type like "text/plain". AUTHORS
This module has been written and rewritten by different people from Dancer project. LICENCE
This module is released under the same terms as Perl itself. SEE ALSO
Dancer perl v5.14.2 2011-11-30 Dancer::MIME(3pm)

Check Out this Related Man Page

mime.convs(5)						      Easy Software Products						     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 to other files in the configuration directory (/etc/cups) with the extension ".convs". Each line in the mime.types 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), CUPS Software Administrators Manual, http://localhost:631/docu- mentation.html COPYRIGHT
Copyright 1993-2002 by Easy Software Products, All Rights Reserved. 22 June 2000 Common UNIX Printing System mime.convs(5)
Man Page

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

add to first line of file using perl

Hey guys, I have a text file full of data and all I want to do with the thing is add the file extension name to the first line of the file. Here is what I have so far. I can't remember how to append to the first line of the file without deleting the exsisting data. #!/usr/local/bin/perl ... (5 Replies)
Discussion started by: kingdbag
5 Replies

2. Shell Programming and Scripting

help with mime

hey, i need some help with mime and hebrew. i have a script sending a multipart mime . the problem is that the subject is recived in jibrish. i need to know how to explictly define charset for the subject. i would appericiate any help, thanx in advance, rafi (0 Replies)
Discussion started by: rafiyaari
0 Replies

3. Shell Programming and Scripting

Retrieving File's Mime-type

Alright, so I am trying to use perl (or any other shell scripting language, awk/sed/bash for instance), to retrieve the mime-type of a file. I want to keep it in one file, and most of the modules that are on cpan that check for mime types (Magic), aren't installed on these boxes. Anyone have... (2 Replies)
Discussion started by: Rhije
2 Replies

4. Shell Programming and Scripting

ambigouity on using Mime::Lite?

Hi Everyone, I have a question related to using MIME::Lite module in perl.Below i mentioned code blocks used for sending mail through MIME::Lite. $msg = MIME::Lite -> new ( From => $from, To => $to, Subject... (0 Replies)
Discussion started by: DILEEP410
0 Replies

5. Shell Programming and Scripting

Script to Convert HTML to MIME mail -- HELP!

Hi: I have writed a script that read a HTML file and convert this in a multipart mime fail to send in a mail. But the result isn't interpreted lika a mime file!! Somebody can see the error??? --------------------------- #! /bin/bash SB=$1 IF=$2 OF=$3 rm -f $OF.b64 ... (7 Replies)
Discussion started by: sushisan
7 Replies

6. 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

7. UNIX for Dummies Questions & Answers

Help with combining the ls and 'file' commands

I have a directory of 3000 files without extensions (Solaris 5.10). I would like to iterate the file names through the 'file' command and output their mime types (most are pdf or jpg, but a very few might be psd or swf which show simply as 'data') So, I would like the output of the 'ls'... (2 Replies)
Discussion started by: pwallace
2 Replies

8. 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