Ok, I am sure this is an easy issue for someone and I am just missing 
something simple but this is kicking my @$$!

I have a client who needs to upload images from his Mac to a WIN2K server 
running CF5. here is the code. If it is easier for you to rewrite the code 
please do.
Any and all help will be appreciated.


<code>


UPLOAD FORM PAGE
<FORM action="smimgup.cfm" method="post" enctype="multipart/form-data">

                         <CFOUTPUT>

                                         <cfif image eq 'medimg'>
                                         <input type="file" name="medIMG" 
id="medIMG" size="35" accept="image/jpg, image/jpeg, image/pjpeg, 
image/gif, image/tiff, image/png">
                                         <cfelseif image eq 'smimg'>
                                         <input type="file" name="smIMG" 
id="smIMG" size="35" accept="image/jpg, image/jpeg, image/pjpeg, image/gif, 
image/tiff, image/png">
                                         <cfelseif image eq 'lgimg'>
                                         <input type="file" name="lgIMG" 
id="lgIMG" size="35" accept="image/jpg, image/jpeg, image/pjpeg, image/gif, 
image/tiff, image/png">

</cfif>
                                         <INPUT type="Hidden" name="here" 
value="#image#">
                                         <input type="hidden" name="prodid" 
value="#url.prodid#">
                         </CFOUTPUT>


RESULT PAGE

<cffile action="UPLOAD"
filefield="lgIMG"
destination="#application.imgsrc#"
nameconflict="MAKEUNIQUE"
accept="image/jpg, image/jpeg, image/pjpeg, image/gif">
<!--- #file.clientfile# --->
#form.prodid#
<cfquery name="checkid" datasource="#application.db#">
select *
from image
where prodid = #form.prodid#
</cfquery>
<cfif checkid.recordcount eq 0>
<cfquery name="insert" datasource="#application.db#">
insert into image(prodid, #form.here#)
values (#form.prodid#, '#file.clientfile#')
</cfquery>
<cfelse>
<cfquery name="update" datasource="#application.db#">
update image
set
#form.here# = '#file.clientfile#'
where prodid = #form.prodid#
</cfquery>
</cfif>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to