Implement custom version of CMS.File

Tom Troughton asked on July 10, 2015 14:15

I need to implement a custom version of CMS.File. This is because the physical files in question will be located on a third party system so need to be referenced by URL rather than being uploaded. However, I want Kentico to behave in the same way as with CMS.File i.e. when editing in the content tree the editor can edit the file's metadata but when viewing on the live site a download is triggered. And I need the download logged as a contact activity etc.

I know that CMS.File uses Kentico's GetFile.aspx to manage the downloading of the file. What I'm not clear about is how Kentico uses this webform to achieve the behaviour described above. Your advice would be very welcome.

Recent Answers

Jon White answered on July 14, 2015 10:48

Hi there,

I think this question is possibly related to the same functionality as what I'm looking for; I'd like to change the default behavior of the CMS.File type to act like a 'page' so a user can click it and go to a page then download the file.

I need this as i want users to add text/descriptions and other info about the documents if needed.

Sorry if this isn't along the same lines but I'd like some input from someone about how the cms.file type behaves, and how we can modify it if possible.

Thanks, Jon

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on July 21, 2015 12:49


the logic to handle the CMS.File page types is hardcoded in the source code. Without access to the source code you will need to create a custom script similar to the GetFile script and link your custom page type pages using this script.

you can add custom fields to the CMS.File page type as to any other page type - so you can add the description and text fields to the page type fields definition.

0 votesVote for this answer Mark as a Correct answer

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