If a file is uploaded and no CFFILE Upload tag exists to process it, does it really upload?
Need proof? Just do an form file upload to a CFM page that has no CFFILE Action="upload". The file will still be uploaded, to a temp directory (from which CFFILE *would* move it). There's a trick, though. The temp file (literally with a .tmp extension) will be removed when the upload page processing is done. You need to pause the page long enough to watch the directory to see it uploaded. Fortunately, in CFMX and BD, that's easily done.
Here's a template that demonstrates it all (see the comments/explanation that would appear onscreen):
<input type="File" name="test"><br>
<input type="Submit"><br>
</form>
File will be uploaded to this directory: <br>
<textarea cols="100">
<cfoutput>#gettempdirectory()#</cfoutput>
</textarea><br>
The filename above was put in a text area to make it easy to copy/paste. Open that directory with windows exporer or its equivalent, and run the upload. Refresh the directory display to see the .tmp file. This page has been set to pause for 5 seconds after the upload. The tmp file will disappear when the form submission page process has completed.
<cfif request_method is "post">
<cfscript>
thread = createObject("java", "java.lang.Thread");
thread.sleep(javaCast("long", 5000));
</cfscript>
</cfif>
Hope this helps someone.






Yes its working.
I had learned from my first efforts with CFFile that it doesn't actually upload the file, it just transfers it from the server's temp directory to the specified directory, or to the application's memory. From what I understand, the file form field just gives a path to the uploaded file in the temp directory.
That said, even though CFFile may not be working as advertised, there are still ways you can upload the file and process the uploaded file using the java.io.String and FileReader classes. Samuel Neff gives a very nice discussion on how to do this on his blog:
http://www.rewindlif...
Of course this assumes that your shared hosting account allows you to use createObject and java in general.
See you at CFUnited.
larry