for free
http://www.web-instan.com/web-instan/overview/2.html
<http://www.web-instan.com/web-instan/overview/2.html>
I've got a friend doing 10 weeks overseas (on a holiday - some people have
all the luck :-) and I just loaded this onto our site so he can upload his
digi cam pics to our server from where he is at up to 20 at a time.
**********
Kevin Parker
Web Services Manager
WorkCover Corporation
e: [EMAIL PROTECTED]
w: www.workcover.com
p:+ 61 8 8233 2548
f: +61 8 8233 2282
m: 0418 806 166
**********
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 25 November 2003 9:54 AM
To: CF-Talk
Subject: Re: Advise about how to upload multiple files
you may wanna concider letting them upload say 5 at a time and having 5
table fields for images in your db.
then just add 5 file fields to the form with names like pic1, pic2, pic3,
pic4, pic5. then on the action page u need the upload file code for each
field but you really need to check each field to make sure it has
something in it first. you can do this with a simple if statement. then to
you need to set the serverfile to a unique name cause u can only have 1 to
do the db insert
this line is VERY IMPORTANT
<cfset pic1 = #file.serverfile#>
because when u go to do the insert they each need unique names
something like this (of course change to fit your needs)
<!---
Author: .::. ME .::. [EMAIL PROTECTED]
Date Created: 08/12/03
--->
<!--- make sure productID was passed on --->
<cfif NOT isdefined("form.submit")>
<h2>Sorry there has been an error, please try again</h2>
<p><a href="" back</a></p>
<cfabort>
</cfif>
<!--- do the file 1 upload now --->
<cfif #form.pic1# NEQ "">
<cffile Action=""> Filefield="pic1"
DESTINATION="C:\Websites\folder\site\uploads\"
Nameconflict="makeunique" accept="image/*">
<cfset pic1 = #file.serverfile#>
</cfif>
<!--- do the file 2 upload now --->
<cfif #form.pic2# NEQ "">
<cffile Action=""> Filefield="pic2"
DESTINATION="C:\Websites\folder\site\uploads\"
Nameconflict="makeunique" accept="image/*">
<cfset pic2 = #file.serverfile#>
</cfif>
<!--- do the file 3 upload now --->
<cfif #form.pic3# NEQ "">
<cffile Action=""> Filefield="pic3"
DESTINATION="C:\Websites\folder\site\uploads\"
Nameconflict="makeunique" accept="image/*">
<cfset pic3 = #file.serverfile#>
</cfif>
<!--- do the file 4 upload now --->
<cfif #form.pic4# NEQ "">
<cffile Action=""> Filefield="pic4"
DESTINATION="C:\Websites\folder\site\uploads\"
Nameconflict="makeunique" accept="image/*">
<cfset pic4 = #file.serverfile#>
</cfif>
<!--- do the file 5 upload now --->
<cfif #form.pic5# NEQ "">
<cffile Action=""> Filefield="pic5"
DESTINATION="C:\Websites\folder\site\uploads\"
Nameconflict="makeunique" accept="image/*">
<cfset pic5 = #file.serverfile#>
</cfif>
<!--- insert the contents of the form into the db --->
<cfif isdefined ("form.submit")>
<cfquery name="qaddlisting" datasource="#dsn#">
INSERT INTO listings (stock, company, model, price, type, year,
condition, newUsed, color, hitchStyle, construction, axels,
sleeps, hauls, floorLength, tires, emptyWeight, description,
overallEquiptment, stallAreaEquiptment, dressingRoom,
foldingRearTack, pic1, pic2, pic3, pic4, pic5)
VALUES ('#form.stock#', '#form.company#', '#form.model#',
'#form.price#', '#form.type#', '#form.year#', '#form.condition#',
'#form.newUsed#', '#form.color#', '#form.hitchStyle#',
'#form.construction#', '#form.axels#', '#form.sleeps#',
'#form.hauls#', '#form.floorLength#', '#form.tires#',
'#form.emptyWeight#', '#form.description#',
'#form.overallEquiptment#',
'#form.stallAreaEquiptment#', '#form.dressingRoom#',
'#form.foldingRearTack#',
'#pic1#', '#pic2#', '#pic3#', '#pic4#', '#pic5#')
</cfquery>
</cfif>
<!--- send to menu --->
<cflocation url="" addtoken="no">
>
>
> Message: http://www.houseoffusion.com/lists.cfm?link=i:4:144953
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

