Ticket #321 (closed defect: invalid)
formurl2attributes killing my array
| Reported by: | hotmediagroup | Owned by: | scorfield |
|---|---|---|---|
| Type: | defect | Priority: | High |
| Milestone: | Web Site 1 | Component: | Skeleton Applications |
| Version: | 1.0 | Severity: | major |
| Keywords: | formurl2attributes array | Cc: |
Description
I've been searching the internet to solve a problem I'm having in a system I'm putting together. I'm sending a list of files and their contents to a cfloop which is looking for the form field form.userfile[0] I've changed it to #attributes.. Well here is the code.
<cfset variables.filelist = "">
<cfset variables.nameconflict = "makeunique">
<cfset variables.destination = "#request.siteroot#\photos">
<!------------------ LOOP OVER FORM.USERFILE[NO] - Break when it's finished ------------------------>
<cfloop from="0" to="10000" index="i">
<cftry>
<cffile action="upload" filefield="#attributesuserfile[0]?#" destination="#variables.destination#" nameconflict="#variables.nameconflict#">
<!--- <cfquery datasource="#request.maindsn#">
insert into photos
</cfquery> --->
<cfset variables.filelist = variables.filelist&",#cffile.serverfile#">
<cfcatch><cfbreak></cfcatch>
</cftry>
</cfloop>
<cfloop list="#variables.filelist#" index="i">
<cfoutput>Image <b>#i#</b> has been uploaded.<br></cfoutput>
</cfloop>
The error I get is from line 80 of the formurl2attributes page from the original fusebox code. My guess is that it's trying to change the form values from the array and finding that there are more than one value and causing an error because possibly this first formurl2attributes wasn't designed to allow this type of array through the file...
Any ideas?
btw, the reason I'm using fusebox 1 is that this is an application first developed back in 2000 and I'm just adding to it now.
Thanks!
