Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mime type for .txt files?

I´m trying to share a .txt file with share intent. If I set "text/plain" as mime type, it reads the content like text not like text file, then the options given in the share menu are Whatsapp, Line, etc..

Does anybody know how to configure the share intent so that the share options are only the programs that are able to send a .txt file (Gmail, Dropbox, etc.. but not Whatsapp..)? Thanks

like image 690
Viker Avatar asked Jan 24 '13 00:01

Viker


People also ask

What is MIME type for all files?

Use "application/octet-stream" for the "All files (*)" filter, since that is the base MIME type for all files.

How do you specify the MIME type of a file?

By File Content. Another way to get the MIME type of a file is by reading its content. We can determine the MIME type according to specific characteristics of the file content. For example, a JPG starts with the hex signature FF D8 and ends with FF D9.

How do I know my MIME type?

For detecting MIME-types, use the aptly named "mimetype" command. It has a number of options for formatting the output, it even has an option for backward compatibility to "file". But most of all, it accepts input not only as file, but also via stdin/pipe, so you can avoid temporary files when processing streams.


1 Answers

You can try the specific mime:

text/plain 

or, the more general text mime:

text/* 
like image 140
KickAss Avatar answered Oct 13 '22 04:10

KickAss