Hi Rick.

I started with this code below:

http://tutorial40.learncf.com/

I used two pages insert_form.cfm and insert_action.cfm

I added a field in the DB called image to the artists table

I also added a folder called user_photos

On the insert_form.cfm page I added:

<cfform action="insert_action.cfm" method="post" enctype="multipart/form-data">
<cfinput type="file" name="image" id="image" size="50">

On the insert_action.cfm page I added:

INSERT INTO artists
image

Values
<cfqueryparam cfsqltype="cf_sql_varchar" value="#FORM.image#">

<cfset imageDirPath = ExpandPath("user_photos")>

    <cfset userPhotoPath = "#imageDirPath#/thumb.jpg">

    <!--- Accept the file upload --->
    <cffile
        action="upload"
        destination="#getTempDirectory()#"
        fileField="image"
        nameconflict="makeunique">

    <!--- Get info about the photo --->
    <cfimage
        action="info"
        source="#cffile.serverDirectory#\#cffile.serverFile#"
        structName="uploadedFileInfo">

    <!--- Convert the photo --->
    <cfimage
        action="resize"
        width="300"
        height="300"
        source="#cffile.serverDirectory#\#cffile.serverFile#"
        destination="#userPhotoPath#"
        overwrite="true">

There are no error messages. But in the DB, the image field displays 
"C:\ColdFusion8\runtime\servers\coldfusion\SERVER-INF\temp\wwwroot-tmp\neotmp9855.tmp"

Thanks...Barry 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329132
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to