Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FindMimeFromData
Message
De
29/05/2001 07:16:55
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00512103
Message ID:
00512130
Vues:
12
Thanks Vlad,

This seems to work.
And yes, you have it right. My intention is to determine the file type of the disk in windows.
And indeed the closest I came to this was the MIME type.
Untill now I didn't find a way to really assure that for example a file with an extension .dbf isn't a plain txt file but really a dbf file.

I hope the FindMimeFromData will already provide me with some feedback and allows me to do some automation and implement some extar safety.

BTW,
I assume that the @ppwzMimeOut gets populated with the mime type.
But the variable contains some 'strange' characters I can't define.
Do you have an idea how to transform this so it returns something meaningfull.
something like zip, dbf...
Or how to have the mime type returned from this function.


Thanks.


>Hi!
>
>Try following:
>
>DECLARE INTEGER FindMimeFromData IN ??? integer pBC, ;
>string @pwzUrl, string @pBuffer, integer cbSize, string @pwzMimeProposed,;
>integer dwMimeFlags, string @ppwzMimeOut, integer dwReserved
>
>If you want to use NULL value for pwzUrl, pBuffer or pwzMimeProposed parameters, declare these parameters as integer type and pass zero to function. I'm also not sure about ppwzMimeOut parameter. If it is double-pointer, you will require to use the API functions to allocate the memory for that parameter.
>
>HTH.
>
>P.S.
>Well, if you meant the file type of the disk file in Windows, it is determined by Windows using the file extension. And I do not remember any function that verifies if, for example, '.DBF' file really is not a text file. As about the FindMimeFromData function, it just "Determines the MIME type from the data provided." as I see in the MSDN help. If you meant something else, well, be more exact in your questions next time.
>
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform