Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cffile wierdness - the ongoing saga 1

Status
Not open for further replies.

PTmon

IS-IT--Management
Mar 8, 2001
284
US
I have a form with 3 areas for file uploads. The files upload great, and when I look at them on the server they are named correctly. However, when I insert into the datase I get a file path and a temp name, instead of the filename. (C:WINNTTEMPACFF3.tmp) I can't use file.serverfile as I'm uploading up to 3 files at once?

<cfquery name=&quot;insertmedia&quot; Datasource=&quot;application.dsn&quot; username=&quot;application.user&quot; password=&quot;application.password&quot;>
Insert INTO media(description,pdf,audio,video,uploaddate) VALUES('#Trim(form.description)#', '#Trim(Form.pdf)#', '#Trim(form.audio)#', '#Trim(form.video)#', #today#)
</cfquery>

 
This is something I used to upload a thumbnail and large image.

<cfset idesty = &quot;your folder path&quot;>

<cfif #form.sm_image# is not &quot;&quot;>
<cffile action=&quot;UPLOAD&quot; filefield=&quot;form.sm_image&quot; destination=&quot;#idesty#&quot; NAMECONFLICT=&quot;MakeUnique&quot; attributes=&quot;Normal&quot;>
<cfset file1 = #File.ServerFile#>
<cfelseif #form.sm_image# IS &quot;&quot;>
<cfset file1 = &quot;&quot;>
</cfif>

<cfif #form.lg_image# is not &quot;&quot;>
<cffile action=&quot;UPLOAD&quot; filefield=&quot;form.lg_image&quot; destination=&quot;#idesty#&quot; NAMECONFLICT=&quot;MakeUnique&quot; attributes=&quot;Normal&quot;>
<cfset file2 = #File.ServerFile#>
<cfelseif #form.lg_image# IS &quot;&quot;>
<cfset file2 = &quot;&quot;>
</cfif>

<cfquery name=&quot;AddImages&quot; Datasource=&quot;db_solidsurfacecraftsman_com&quot;>
INSERT INTO gallery1
(img_text,sm_image,lg_image)
VALUES
('#Form.img_text#','#file1#','#file2#')
</cfquery>
</cfif>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top