Since version 9.0.1 (if I am not mistaken) ColdFusion supports Amazon's S3 file storage pretty much out of the box. The complexities of access control to your bucket is abstracted away and you can use S3 almost like a local file system. You can read more about it in the CF docs and on Ray Camden's blog.
My task at hand was to accept user submitted file uploads and store them in S3. According to the CF documentation the full set of cffile operations is supported, however I could not get it to work.
The following failed for me with a 'destination invalid' error:
2<cffile action="upload" filefield="logo" destination="#mydir#" nameconflict="makeunique" charset="utf-8" />
Please note that in order for the s3:// syntax to resolve to your bucket you need to follow some setup steps which I won't cover here. Also watch out for a bug related to setting metadata.
A quick note about this article: I chose a slightly misleading title in order to help people find it more easily as most would not know that a search for 'rewrapping .mts files' is what they may be after.



