I have an application that allows admins to upload files. These files are stored outside of the web root so they are not accessible via a URL. In the past, we have always used code similar to below to then serve the file back to authorized users. Is there a better or more universal way to specify the type? This is especially relevant when admins are allowed to upload many different types of files.
<cfheader name="content-disposition" value="filename=#queryname.filename#">
<cfcontent type="application/unknown" file="#application.pathToDataDirectory#/#queryname.filename#">