> In a more broad situation, in which you're trying to extract *any* file
> extension, how would you got about it?

The file extension is not really a good indicator as to what type of file
it really is, it is the more mime type - it depends on what you want to do
with the file i guess. I've used the follwoing code to determine a file
mime type before if that helps?

<cfobject name="mimeType" class="javax.activation.MimetypesFileTypeMap" 
type="java" action="create">
<cfobject action="create" type="java" class="java.io.File" name="fileHandler">
<cfscript>
        // determine mime type of a file
        mimetype =
mimeType.init().getContentType(fileHandler.init("C:\myfile.doc"));
</cfscript>
<cfoutput>
MimeType - #mimetype#
</cfoutput>

You'll need the jaf activation.jar file dumped into your <cfmx>/wwwroot/classes
directory from here

http://java.sun.com/products/javabeans/glasgow/jaf.html

rod

---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to