In your INSERT statement, access the name of the file from your upload
statement using #cffile.Serverfile#.
Ex:
<cfif isDefined("FORM.submit")>
<cffile.........>
<cfquery datasource="mydb">
INSERT INTO products (imagepath)
VALUES (
'#cffile.Serverfile#'
)
</cfquery>
Obviously, you will want to do all the necessary validation and
cfqueryparams...but that is a quick and dirty way to grab the name of the file
that has been uploaded to the server and insert it into your database.
> Hi:
> Do you know any tutorial that teaches me how to make an image upload
> form that I can use with my "Add Product" page? I need it to be
> something like the one in cartweaver shopping cart. I mean when you
> upload the image it is uploaded and the address goes to the database
> at the same time and the user doesn't have to type the name/address of
> the image (after uploading it) in another form to insert it into the
> database.
> In summary I need an upload image form that uploads the image and
> inserts the name/address of the image into the proper field of the
> database for the right product.
> Thanks
Benign
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:277073
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4