Getting the real mime type in a renamed file
up vote
2
down vote
favorite
I have a problem finding out what is the real mime type of a file whose name and extension was changed. For example, the file "app.exe" renamed to "picture.png" or "document.pdf", how can I get that the real mime type is ".exe"?
Thanks for your help.
Regards,
android file mime-types
add a comment |
up vote
2
down vote
favorite
I have a problem finding out what is the real mime type of a file whose name and extension was changed. For example, the file "app.exe" renamed to "picture.png" or "document.pdf", how can I get that the real mime type is ".exe"?
Thanks for your help.
Regards,
android file mime-types
Check out the file signature ("magic" bytes at the very beginning of the file). Plain text files (note: csv files are plain text files) do not have it.
– Kling Klang
Nov 7 at 11:59
Thanks for answering! Very useful information about magic bytes. But, how can I verify that a plain text file is really a plain text file?
– DanSC
Nov 7 at 14:21
Well, if all the magic signatures you checked do not match, then it's probably a plain text file. As I said, csv data files and programming source files (including batch/scripts but excluding markup languages) are indistinguishable from actual texts.
– Kling Klang
Nov 7 at 15:33
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have a problem finding out what is the real mime type of a file whose name and extension was changed. For example, the file "app.exe" renamed to "picture.png" or "document.pdf", how can I get that the real mime type is ".exe"?
Thanks for your help.
Regards,
android file mime-types
I have a problem finding out what is the real mime type of a file whose name and extension was changed. For example, the file "app.exe" renamed to "picture.png" or "document.pdf", how can I get that the real mime type is ".exe"?
Thanks for your help.
Regards,
android file mime-types
android file mime-types
edited Nov 7 at 11:57
Kling Klang
32k156286
32k156286
asked Nov 7 at 7:26
DanSC
111
111
Check out the file signature ("magic" bytes at the very beginning of the file). Plain text files (note: csv files are plain text files) do not have it.
– Kling Klang
Nov 7 at 11:59
Thanks for answering! Very useful information about magic bytes. But, how can I verify that a plain text file is really a plain text file?
– DanSC
Nov 7 at 14:21
Well, if all the magic signatures you checked do not match, then it's probably a plain text file. As I said, csv data files and programming source files (including batch/scripts but excluding markup languages) are indistinguishable from actual texts.
– Kling Klang
Nov 7 at 15:33
add a comment |
Check out the file signature ("magic" bytes at the very beginning of the file). Plain text files (note: csv files are plain text files) do not have it.
– Kling Klang
Nov 7 at 11:59
Thanks for answering! Very useful information about magic bytes. But, how can I verify that a plain text file is really a plain text file?
– DanSC
Nov 7 at 14:21
Well, if all the magic signatures you checked do not match, then it's probably a plain text file. As I said, csv data files and programming source files (including batch/scripts but excluding markup languages) are indistinguishable from actual texts.
– Kling Klang
Nov 7 at 15:33
Check out the file signature ("magic" bytes at the very beginning of the file). Plain text files (note: csv files are plain text files) do not have it.
– Kling Klang
Nov 7 at 11:59
Check out the file signature ("magic" bytes at the very beginning of the file). Plain text files (note: csv files are plain text files) do not have it.
– Kling Klang
Nov 7 at 11:59
Thanks for answering! Very useful information about magic bytes. But, how can I verify that a plain text file is really a plain text file?
– DanSC
Nov 7 at 14:21
Thanks for answering! Very useful information about magic bytes. But, how can I verify that a plain text file is really a plain text file?
– DanSC
Nov 7 at 14:21
Well, if all the magic signatures you checked do not match, then it's probably a plain text file. As I said, csv data files and programming source files (including batch/scripts but excluding markup languages) are indistinguishable from actual texts.
– Kling Klang
Nov 7 at 15:33
Well, if all the magic signatures you checked do not match, then it's probably a plain text file. As I said, csv data files and programming source files (including batch/scripts but excluding markup languages) are indistinguishable from actual texts.
– Kling Klang
Nov 7 at 15:33
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
Check this answer. The main idea - all files have their type inside themselves. It means that you can read first bites and use this information to identify filetype and manually add extension or do whatever you want.
Hi! Thank you very much for the information, I have advanced a lot in solving the problem using the magic bytes to identify the filetype.
– DanSC
Nov 7 at 14:24
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Check this answer. The main idea - all files have their type inside themselves. It means that you can read first bites and use this information to identify filetype and manually add extension or do whatever you want.
Hi! Thank you very much for the information, I have advanced a lot in solving the problem using the magic bytes to identify the filetype.
– DanSC
Nov 7 at 14:24
add a comment |
up vote
1
down vote
Check this answer. The main idea - all files have their type inside themselves. It means that you can read first bites and use this information to identify filetype and manually add extension or do whatever you want.
Hi! Thank you very much for the information, I have advanced a lot in solving the problem using the magic bytes to identify the filetype.
– DanSC
Nov 7 at 14:24
add a comment |
up vote
1
down vote
up vote
1
down vote
Check this answer. The main idea - all files have their type inside themselves. It means that you can read first bites and use this information to identify filetype and manually add extension or do whatever you want.
Check this answer. The main idea - all files have their type inside themselves. It means that you can read first bites and use this information to identify filetype and manually add extension or do whatever you want.
answered Nov 7 at 7:39
Arthur
345210
345210
Hi! Thank you very much for the information, I have advanced a lot in solving the problem using the magic bytes to identify the filetype.
– DanSC
Nov 7 at 14:24
add a comment |
Hi! Thank you very much for the information, I have advanced a lot in solving the problem using the magic bytes to identify the filetype.
– DanSC
Nov 7 at 14:24
Hi! Thank you very much for the information, I have advanced a lot in solving the problem using the magic bytes to identify the filetype.
– DanSC
Nov 7 at 14:24
Hi! Thank you very much for the information, I have advanced a lot in solving the problem using the magic bytes to identify the filetype.
– DanSC
Nov 7 at 14:24
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53185085%2fgetting-the-real-mime-type-in-a-renamed-file%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Check out the file signature ("magic" bytes at the very beginning of the file). Plain text files (note: csv files are plain text files) do not have it.
– Kling Klang
Nov 7 at 11:59
Thanks for answering! Very useful information about magic bytes. But, how can I verify that a plain text file is really a plain text file?
– DanSC
Nov 7 at 14:21
Well, if all the magic signatures you checked do not match, then it's probably a plain text file. As I said, csv data files and programming source files (including batch/scripts but excluding markup languages) are indistinguishable from actual texts.
– Kling Klang
Nov 7 at 15:33