Thanks Kris, the solution for the IsPrimary issue works well.

I'm not sure I follow you on the first issue. If I only fill out the first 
upload field, I get an error stating, "The form field 'file2' did not contain a 
file."

Rick




>First, check for file existence before the transaction for each
>iteration of the loop.
>
>On the isPrimary issue, if the first image is always the primary
>image, then you don't need a form element for it, right? So, either
>set a variable to 1 or 0 depending on which iteration of the loop
>you're on, and use that value on your insert statement, or use an
>expression like #iif("i is 1","1","0")#
>
>Cheers,
>Kris
>
>
>[snip]
>
>> <!--- Upload to database --->
>> <cfquery datasource="wioDB">
>>    INSERT INTO Images (ProdID, Image, IsPrimary)
>>    VALUES (#Product.ProdID#,'#cffile['file'&i].serverFile# ', 
>> '#FORM.IsPrimary#')
>>     </cfquery>
>>
>> </cfloop>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271140
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