Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FindMimeFromData
Message
From
29/05/2001 07:16:55
 
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00512103
Message ID:
00512130
Views:
11
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.
>
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform