Kentico Form File Upload clears if form not fully validated

David Waters asked on December 29, 2015 20:40

I am building out a form in Kentico v9.0 and we have a file upload field. The upload works fine however if another field fails its validation then the file disappears and the user has to go back in and re-upload all the upload file fields. Is there is a way to have the file stay attached to the form until all the fields have passed validation? Everything other than the file stays attached to the form if something doesn’t pass validation is there was a setting somewhere for the upload field. I noticed when I try and submit a question or bug here http://devnet.kentico.com/support and I select a file but keep the subject blank the file stays with the form which leads me to believe it is possible.

Recent Answers


Bryan Soltis answered on January 4, 2016 16:04

Hi David,

I believe the issue you are seeing is due to the ASP.NET File Upload control (what the Kentico Upload File web part is based on). This .NET control is notoriously very picky about how it functions and when a postback occurs, it will almost always empty itself (even if an error happens). In the past, I have gotten around this issue by Using client-side JS to validate a form before posting back. You may need to add a custom form layout (or even a custom web part) to implement it, but that should hopefully give you a workaround.

  • Bryan
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.