Ver Mensaje Individual
  #7  
Antiguo 11-10-2016
Avatar de jhonny
jhonny jhonny is offline
Jhonny Suárez
 
Registrado: may 2003
Ubicación: Colombia
Posts: 7.058
Reputación: 30
jhonny Va camino a la famajhonny Va camino a la fama
Bueno, no sé si he llegado tarde... en fin, para saber el MimeType de un archivo, también puedes usar las Indy:

Código Delphi [-]
Uses IdGlobalProtocols;

function GetMIMEType(sFile: TFileName): string;
var
  aMIMEMap: TIdMIMETable;
begin
  aMIMEMap := TIdMIMETable.Create(true);
  try
    result := aMIMEMap.GetFileMIMEType(sFile);
  finally
    aMIMEMap.Free;
  end;
end;

Y usarla así:

Código Delphi [-]
  
if OpenDialog1.Execute() then
    ShowMessage(GetMIMEType('C:\RutaArchivo.ext'));

Sacado de http://stackoverflow.com/questions/2...rver-with-indy
__________________
Lecciones de mi Madre. Tema: modificación del comportamiento, "Pará de actuar como tu padre!"

http://www.purodelphi.com/
http://www.nosolodelphi.com/
Responder Con Cita