I'm being stymied by what I thought would be the relatively simple task of creating functionality to allow users to upload a picture to a server directory and am looking for some help.
I have a simple form with a straightforward interface, passing a variable named 'imagedata' which is the data passed from a file input, a variable named 'name' which is a specified image name, and a variable named 'imagetype' which passes a file extension.
The code I'm using in the function (handler) to save this file is as follows:
<cfset form.imageName = form.name & "." & form.imagetype />
...
<cffile action="write" file="#sitepath#storage/bannerImages/#form.imagename#" output="#form.imageData#" />
This apparently won't work; it will save a file with the correct name, but does not save the file correctly and doesn't render as an image. I would think that this is something relatively simple, and I would think I've overlooked something because I'm not finding anything on google, which is odd. Help with this problem would be appreciated.