Change online form file location programmatically

Tom Wisneski asked on August 24, 2020 16:43

Is it possible to change the location that the "upload file" form control (online forms / bizforms). Beyond going to Kentico's "Settings > System > files > Custom form files folder." By default the control is sending files to the directory (name of the site > BizformFiles). I would like to set the location programmatically in which the file are stored.

Recent Answers


Brian McKeiver answered on August 27, 2020 18:21 (last edited on August 27, 2020 18:23)

One way that I know of is if you clone the Upload File control (create a complete copy of the existing one) then add some code like a SaveBizFormFile method that manipulates the the incoming posted file from the Raw Request. It would be an effort though, and definitely fully custom.

A second choice would be to write a Global Event handler, wait for the BizFormFile to get to its normal place on a standard form submit event, and after the standard submit is complete, then attach some code that moves the file to the place you want it.

Neither are totally great option to be honest.

0 votesVote for this answer Mark as a Correct answer

Tom Wisneski answered on August 27, 2020 18:28

Brian, Thanks for the reply. At this time I had to go with Kentico's "Settings > System > files > Custom form files folder." Sadly it sounds like the only reliable option in the scenario. Thanks. Tom W.

0 votesVote for this answer Mark as a Correct answer

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