Janrow
asked on
Why is my user image cffile uploads not working?
I'm using cffile for users to upload images. All seems to go fine when I test but there is never any image in the destination directory, which does exist. No errors.
FYI, I will want to limit the file size and possibly resize the image if too large.
Is there a better way to do this using CF8?
FYI, I will want to limit the file size and possibly resize the image if too large.
Is there a better way to do this using CF8?
<cfif isdefined("form.iupload") and len(form.myImage)>
<cfset myFileName = "">
<cffile action="upload"
destination="C:\ColdFusion8\wwwroot\baker\user_content\"
nameconflict="makeunique"
filefield="myImage"
accept="image/jpg,image/gif">
<cfset myFileName = cffile.serverFile>
<cfoutput>
The file Uploaded was #myFileName#
</cfoutput>
</cfif>
<form name="iupload" action="send.cfm" method="post" enctype="multipart/form-data">
Upload image: <input type="file" name="myImage"> <input type="submit" value="Upload">
</form>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That seems to have done it! Thanks!
Open in new window