Reputation: 305
If you use cffile action = "upload"
you get a load of meta data (e.g., the filesize, fileextension etc.).
How do you get the same data for a file that already exists on your server?
I would expect cffile action="read"
to give this but it seems it only gives the content of the file, not the metadata relating to it.
I've googled for this and unless I'm missing something it seems the only way to get the meta data is to upload the file.
Upvotes: 1
Views: 976
Reputation: 2525
You need GetFileInfo function. You need to pass path of file to this function. Please check the documentation.
Example:
<cfset fileinfo = GetFileInfo(temp.pathtoyourfile)>
<cfdump var='#fileinfo#' label="fileinfo">
Upvotes: 6