Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting file type
Message
De
13/08/2005 12:09:04
 
 
À
13/08/2005 12:05:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Divers
Thread ID:
01040691
Message ID:
01040693
Vues:
14
This message has been marked as the solution to the initial question of the thread.
>How can I detect the file type of a file? I am trying to know if a file uploaded is in a JPG format.

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'
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform