Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting file type
Message
From
13/08/2005 14:23:03
 
 
To
13/08/2005 12:09:04
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Miscellaneous
Thread ID:
01040691
Message ID:
01040703
Views:
18
>Check the first few bytes of the file!
>JPG starts with FF-D8-FF-00 (hex) or chr(255)+chr(216)+chr(255)+chr(0)
>GIF starts with GIF (plain text)
>PNG starts wiyh 89-50-E4-47 (hex) which is chr(37)+'PNG'

This doesn't work.
   * First, make sure this is a JPG
   lcString=FILETOSTR(This.cSavePath)
   IF SUBSTR(lcString,1,4)<>CHR(255)+CHR(216)+CHR(255)+CHR(0)
      This.cHtml='This is not a JPG file.'
      ERASE (This.cSavePath)
      RETURN .F.
   ENDIF
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform