This content has been marked as final. Show 5 replies
Don't know about Mach II but passing to a cfc is as follows:
<cfinvoke component="somecfc" method="fileUpLoad" fileField="nameOfFileInput">
The value passed in the fileField variable is the actual name of the input type="file"
I keep getting "backupDoc" does not contain a file, yet when I dump it, it displays the location to the temporary file. Then I have also run a FileExists on it and it does exist.
Post your code and we can see if we see something
My question has been answered by Brian Rinaldi over at Remote Synthesis ( http://www.remotesynthesis.com/blog). He wrote an article on how to deal with uploads via Model-Glue. He was able to clarify his post for me and now I understand what you have to do.
What it comes down to is that you have to submit the name of the fileField in a hidden input field (for lack of a better way at this time) and pass that through your methods rather than the value of your fileField.
I m having trouble with a similar project. I have a form which allows the user to choose a maximum of 3 upload fields. I have a filesystem.cfc file which handles the upload. the cfc code is below:
<cffunction name="upload" access="public" output="false" returntype="struct">
<cfargument name="formFieldName" required="true" type="string" />
<cfset var stReturn = structNew() />
<cfset var stFileUpload = "" />
<cffile action="upload" filefield="formFieldName" destination="#variables.destination#" nameconflict="makeunique" result="stFileUpload" />
<cfset stReturn.success = true />
<cfset stReturn.sourceFile = stFileUpload.serverFile />
<cfreturn stReturn />
when the user submits the form I use the following code is processed:
<!--- loop through fields --->
<cfloop from="1" to="#num#" index="counter">
<cfset fileUpload = fileSystem.upload(formfieldName=FORM["file"&counter]) />
but i get the error message "The form field "formFieldName" did not contain a file".
any help or advice is appreciated, I had a look at Brian Rinaldis blog but its not too clear to me how it works.