Renaming file submitted from Online Form

Yowaraj Chhetri asked on August 15, 2018 04:03

Hi, I find uploading a file via online forms is saved with a GUID as file name. (I have selected to store file in both database/file system from the settings) Is there a way to name a file before saving it on specified file directory which is upload via online form. For example, if a file I am uploading is "abc.pdf", I want to rename this with values of some filed such that the name is now "abc def.pdf". So now the file has custom name instead of guid.

Thanks in advance

Recent Answers


Juraj Ondrus answered on August 15, 2018 10:28

Hi,
form files are always stored on disk under the GUID name by default. So, one option would be using a global event handler for the online form object and save the file in the after save event into your custom location, basically duplicate the file. Or, you can do te same basically on the online form web part level as shown in this example. Or, you can try following the approach from this older article (API- namespaces may have been changed since then)

0 votesVote for this answer Mark as a Correct answer

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