Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
topmind #1
Indirect file upload undocumented feature?
I stumbled across what seems to be an undocumented behavior in
ColdFusion MX that can simplify file uploads if it is reliable.
Example:
**** file: myform.cfm ****
<form action="loader.cfm" method="post" enctype=...>
<input type="file" name="foo" ...>
...
**** file: loader.cfm ****
<cfdump var="#form#">
<cffile action="read" variable="contents" file="#form.foo#">
<cfoutput>#contents#</cfoutput>
If you look at the dump from loader.cfm, you will see a variable "foo"
(form.foo) which contains a path to a temporary file (generated by CF
server I assume) that is the uploaded file contents. It appears one can
simply read that file.
If this is a reliable behavior, then it reduces one having to
explicitly load to a file via CFFILE and then read it back in. I just
want the contents to be loaded into a database in this case; I don't
want to create lasting files so this is good. (I assume the CF server
eventually deletes the temporary file it created, just like most
internal temp files.)
I suspect this is under-documented because it is not associated with
any CF function or tag. It is just what the CF server does with HTTP
stuff from the INPUT HTML tag.
Has anybody used this extensively in production or know a formal
alternative to do the same thing to avoid explicit file creation?
Thanks, -T-
topmind Guest
-
How to upload a file to 2 FTP sites without an upload component for company
Hi All I can't get round this because it's a local government thing, but I've done a CMS for a school (in ASP classic) that allows them to upload... -
CodeHints.xml file...undocumented attributes?
looking in CodeHints.xml file i found some attributes, like displayrestriction, that seems to be not covered in manual. since i actually have a... -
Upload Friendly (Multiple File Upload Applet)
Title : Upload Friendly (Multiple File Upload Applet) Description : UploadFriendly is an easy to use Java Applet that will allow multiple file... -
Undocumented feature of File::Find?
I happened to stumble on a feature of File::Find. Is this an undocumented feature? A bug? I don't see it mentioned anywhere in the Perldocs, but... -
indirect file access
Hi I want to open a file (testmesg.txt) for reading and writing. Ok, normally that is no problem ;) But my script runs by "www-data" and the...



Reply With Quote

