I know the subject is unclear, but here's the situation.
I'm using CF 4.5...
I validate formfields by submitting a form back to the page containing the
form
and using CFTRY / CFCATCH, then, if everything passes validation, setting
the form variables to session variables and then using CFLOCATION to pass
them to an action page for processing.
I haven't, to this point, used this method, with a from that contains a file
upload field.
Typically, with a form that contains a file upload field, I just don't
validate the fields.
I would, however, like to start validating all form submissions, even those
that contain
file upload fields.
The main question is...how would I pass on the "Encoding type:
multipart/form-date" specification
through the form page itself during verification then send that encoding
info along with the session
variables to the processing page using my typical CFLOCATION
URL="" ?
Here's the code I've set up so far to validate the form entries...
<CFIF IsDefined("Form.Submit")>
<CFTRY>
<CFIF Form.Newsletter_Title is "">
<CFTHROW Type="AddError" Message="Please enter a title for
the newsletter.">
</CFIF>
<CFIF Form.Newsletter_Upload is "">
<CFTHROW Type="AddError" Message="Please use the Browse
button below to locate the newsletter file.">
</CFIF>
<CFLOCK Scope="Session" Type="Exclusive" Timeout="10">
<CFSET Session.Newsletter.Newsletter_Title =
Form.Newsletter_Title>
<CFSET Session.Newsletter.Newsletter_Upload =
Form.Newsletter_Upload>
</CFLOCK>
<CFLOCATION URL = "" AddToken="No">
<CFCATCH Type="AddError">
Error Message...
</CFCATCH>
</CFTRY>
</CFIF>
Thanks,
Rick
Rick Faircloth
--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.241 / Virus Database: 262.10.1 - Release Date: 5/16/2004
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

