I'm using uploadify to do file uploads on a form. The files are required on the form. The properties on my model which represent the files have the Required data annotation applied.
I have got uploadify working well and saving the file on the server.
The trouble I'm now having is with validation. I can't figure out how to not show the required messages once the file has been uploaded. Uploadify doesn't seem to set the value attribute on the file input.
I've tried hooking up the onComplete event and setting the file input's value attribute to the Id of the file that was returned by my script but this doesn't work either.
Am I right in the process I'm using?
- User opens form
- User selects file
- Uploadify sends the file to my upload script
- Upload script saves file, creates DB row for the file and returns Id
- Javascript puts the Id of the file in the DB in the file input's value property.
- User submits form
- Server side code links file to the form submission
Is there a better pattern? This doesn't seem to be working for me because of the validation.