Coldfusion form not validating

It is often not sufficient that input data merely exists; it must also have the right format.

Of course, I would say that disabling the spool is probably not a great idea as you might be putting undue stress on the mail server.

Once the file is uploaded, I am validating it against the file extension.

I have been asked several times for a good file upload and email tutorial in Cold Fusion and I have usually pointed people towards partial solutions cause I didn't have anything great to show them.

Then, when I saw Will Peavy ask about this topic over on the CF-Talk list, I figured, I should just sit down and write an example that I can send people to view.

When using these kind of components, the form fields are split into multiple regions which there is only active, visible one at any time.

By default, the invisible fields belonging to inactive regions will be ignored by Form Validation, we need to set . In order to validate particular region, we can use validate Container(container) method.

By putting files into a local temp directory and cleaning it out periodically, we don't have to worry about efficient file deleting.

Therefore, we don't have to worry about deleting files right after they were mailed out and we can let the mail sit in the spool without worrying about corrupting the data.

Furthermore, MIME type checking will cause Cold Fusion to throw an error if an unaccepted MIME type is uploaded.

This just gives you more error handling to worry about.

For those of you who don't know what spooling is, it's basically the way the mail server queues the outgoing mail requests.

Tags: , ,