Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

How can I programatically get all uploaded files for a form that uses the file upload compononent


I need a way to programatically get all uploaded files for a form that uses the "File Upload" component and has the checkbox "store form submissions" checked.

Any suggestions on how to accomplish this?

Best regards!

Jan 12, 2018 15:41

Forms store upload files in "Local Asset Folder" of the [File Upload] element. So you can find the element in your form, then list all the content below "Uploaded Files" folder, you will get all the upload files. Below is how you can find the folder:

var assetFolder = _contentAssetHelper.Service.GetOrCreateAssetFolder(elementContentLink);
var folder = _contentRepository.Service.GetChildren<ContentFolder>(assetFolder.ContentLink)
                .FirstOrDefault(f => f.Name.Equals(Constants.FileUploadFolderName));

elementContentLink in this case is your File Upload element's content link.

Jan 15, 2018 4:25

Thanks for your reply. I marked it as the answer for my question. I had to change 




In order to get my solution to work as expected.

Jan 16, 2018 10:34
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.