> Ali,
>
> Just upload the image as usual to whatever directory you'll be using.
> If it's multiple images with multiple <cffile>'s, and you're using MX7,
> use the result attribute which lets you specify your own variable name
> for each image.
>
> result="file1.serverfile"
> result="file2.serverfile"
>
> etc..
>
> Once you have that, you have the image name you can insert into your
> db.
>
> Just run those in your insert statements.
>
> INSERT INTO tblproducts (image1) VALUES ('#file1.serverfile#')
>
> also, look into ExpandPath(). It's your friend. It'll create your full
> path needed in <cffile> destination attribute.
>
> <cffile action="upload" destination="#ExpandPath("/Images")#" more
> attributes here>
>
> This will let your cffile send the file to the correct directory
> whether on your local machine, or a remote server.In this case, the
> images folder in your site root.
>
> hth,
> Will
Wow that's a great help. just I need some more guide about the above code.
Let me explain my questions. I want to upload 10 images of an animal to the
database. I have one textfield for the name of the animal and 10 fields for
images.
My first question is:
Can I use the name that the user inserts in the text field as a part of each
file name? for example instead of
result = "file1.serverfile"
result = "file2.serverfile"
I use this one: result ="#FORM.name#1.serverfile"
result ="#FORM.name#2.serverfile"
and then if I can do this, how can I set the code
INSERT INTO tblproducts (image1) VALUES ('#file1.serverfile#')
to fit the new naming?
Thanks alot
Ali
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new features.
http://www.adobe.com/products/coldfusion?sdid=RVJR
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:277710
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4