User Tools

Site Tools


finding_20the_20mime_20type_20of_20a_20file

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

finding_20the_20mime_20type_20of_20a_20file [2018/03/31 13:19]
127.0.0.1 external edit
finding_20the_20mime_20type_20of_20a_20file [2018/04/17 16:12] (current)
tbest3112 Added syntax highlighting
Line 2: Line 2:
  
 //by Jon Ripley, May 2007//\\ \\  To read the MIME type of a file call "​FN_GetMIMEType"​ passing it a file extension, for example:​\\ ​ //by Jon Ripley, May 2007//\\ \\  To read the MIME type of a file call "​FN_GetMIMEType"​ passing it a file extension, for example:​\\ ​
 +<code bb4w>
         PRINT "The MIME type of a .html file is ";​FN_GetMIMEType("​html"​)         PRINT "The MIME type of a .html file is ";​FN_GetMIMEType("​html"​)
 +</​code>​
 \\  The code for "​FN_GetMIMEType"​ is:\\  \\  The code for "​FN_GetMIMEType"​ is:\\ 
 +<code bb4w>
         DEF FN_GetMIMEType(T$)         DEF FN_GetMIMEType(T$)
         LOCAL B%, H%, L%, R%, T%         LOCAL B%, H%, L%, R%, T%
Line 15: Line 18:
         ENDIF         ENDIF
         = $$B%         = $$B%
 +</​code>​
 "​FN_GetMIMEType"​ returns an empty string if no MIME type is found in the registry for the requested file extension. To set a default MIME type for all unknown extensions uncomment the specified line and replace **MIMEDefault$** with your fail safe type. "​FN_GetMIMEType"​ returns an empty string if no MIME type is found in the registry for the requested file extension. To set a default MIME type for all unknown extensions uncomment the specified line and replace **MIMEDefault$** with your fail safe type.
finding_20the_20mime_20type_20of_20a_20file.txt ยท Last modified: 2018/04/17 16:12 by tbest3112