I would really appreciate it if someone could explain to me in detail how file upload works.
The reason I am asking is because a client of ours has implemented a global filtering system on the form scope, i.e. removing unwanted characters from the form scope. This is causing problems with the file upload, but I can't seem to make head or tails out of the process. I do know the following;
1. client selects file
2. clients submits form
3. file is uploaded by the browser
4. cf places the file in a temp directory
5. cffile is used to move the file into the appropiate directory
The one thing I cannot seem to get my head around is the fileField attribute on the cffile tag.
Lets say for example that the file input field is called fileToUpload, when I dump the fileToUpload sometimes it contains a directory, and sometimes it contains the contents of the file.
What does cffile do with the field name once it gets it?
Who can expand on the above process?
And most importantly, why is it erroring?
The error is:
Error in CFFILE tag
The form field specified in the CFFILE tag (FILETOUPLOAD) does not contain an uploaded file. Please be sure that you have specified the correct form field name.
The following is the regex that performs the removal of the unwanted characters.
// Horizontal tab
validString = addValidCharacter( validString, chr( 9 ) );
// Line feed, new line
validString = addValidCharacter( validString, chr( 10 ) );
// Carriage return
validString = addValidCharacter( validString, chr( 13 ) );
// Line space
validString = addValidCharacter( validString, chr( 32 ) );
// This string holds any other character strings that should be deleted, delimited by the pipe symbol
orClause = "|@@";
// Following are characters that are allowed
regularExpression = "[^-a-z0-9,./?!@()\_:#vali
dString#]#
orClause#"
;
Start Free Trial