![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Vista Home Premium 32bit | is it possible to determine file mime type? Hallo to everybody. I'd like to know if it's possible to loop a folder searching for a specific kind of file based on its mime type and not on its extension. Thanks in advance. |
My System Specs![]() |
| | #2 (permalink) |
| | RE: is it possible to determine file mime type? What are you after? NTFS does not have file attributes that support MIME nor does the System.IO.FileInfo which Powershell would understand. Most crawlers map file extension to MIME which will be portable between OS's, file systems and applications. bob "sardinian_guy" wrote: Quote: > > Hallo to everybody. I'd like to know if it's possible to loop a folder > searching for a specific kind of file based on its mime type and not on > its extension. Thanks in advance. ![]() > > > -- > sardinian_guy > |
My System Specs![]() |
| | #3 (permalink) |
| Vista Home Premium 32bit | Re: is it possible to determine file mime type? Let's suppose I have a jpg renamed with another extension, let's say txt. I'd like to know if it's possible to detect the real type of this file. |
My System Specs![]() |
| | #4 (permalink) |
| | Re: is it possible to determine file mime type? I sure hope that this doesn't happen often but even if there were a MIME file attribute how could this be guarenteed someone by accident or otherwise couldn't change that also. You'd need to look at the header for this particular type of file. Pretty much all files that I know such as: graphics multi-media ASCII/UNICODE Office EXE/OBJ/DLL/LIB have a well known header format. Since you're making just a simple check: Is this a mp3, wmp, ra file for instance you likely could figure this out by reading less than 64 bytes. Hopefully someone can chime in with a more direct solution. bob "sardinian_guy" wrote: Quote: > > Let's suppose I have a jpg renamed with another extension, let's say > txt. I'd like to know if it's possible to detect the real type of this > file. > > > -- > sardinian_guy > |
My System Specs![]() |
| | #5 (permalink) |
| Vista Home Premium 32bit | Re: is it possible to determine file mime type? Thank you very much Bob. I don't have any real problem to face. It's just a curiosity that I have. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Determine OS version and bit type from the registry | Vista General | |||
| What is the MIME type of Windows Powershell script files (.ps1 fil | PowerShell | |||
| Windows does not recognize this MIME type. | Vista General | |||
| Setting up the Coldfusion document type in MIME mapping on IIS 7.0 Beta | Vista installation & setup | |||