kentcio12 mvc development with media library

innovix solutions asked on February 5, 2019 12:35

Hi All,

How media library will works in kentico 12 MVC development? Since two projects running separately we should keep media library in MVC project or CMS Admin Interface project side?

We are trying to develop a custom image up loader control and wondering how media library should manage and where to keep the physical photos?

When we upload photos via CMS, photos are save into under CMS Folder. When we upload photos via MVC widget Where are we going save the photos?

I think this is big issue and hope kentico team help about this.

Thanks.

Recent Answers


Eric Dugre answered on February 5, 2019 13:44 (last edited on February 5, 2019 13:45)

When developing an MVC application with Kentico, you should always have web farms enabled: https://docs.kentico.com/k12/configuring-kentico/setting-up-web-farms. Web farms ensure that several things are kept "synchronized" between the two environments, mainly cache and physical files (media, attachments, etc).

With web farms configured properly, when you upload a media file to the Kentico project it will automatically be added to the MVC project as well. You can then use our API to generate links to the media file: https://docs.kentico.com/k12/developing-websites/retrieving-content-in-mvc-applications/displaying-content-from-media-libraries.

If you are using page attachments, these are generally stored in the database so you don't need to worry about transferring the files- just use our API to display them. If you store attachments on the disk, web farms will still synchronize them.

0 votesVote for this answer Mark as a Correct answer

innovix solutions answered on February 6, 2019 10:51

Thanks for the reply. One more questions is that we should keep media library in front-end MVC project if we want to put admin interface CMS project behind firewall ?

0 votesVote for this answer Mark as a Correct answer

Filip Ligač answered on February 6, 2019 14:36

By default, content of media libraries is synchronized via web farms and duplicated in the project directories of both the admin interface and MVC application. Therefore you should ensure that firewall settings would not prevent both projects from having access to each other.

0 votesVote for this answer Mark as a Correct answer

innovix solutions answered on February 7, 2019 03:19

Thanks for the response. According to your recommendation, we will keep media files in admin interface project but just want to clarify that in dancing goat MVC project, when we upload images via mvc widget , the images have been kept in front-end MVC project only. Can you please explain me about that as well?

We are middle of developing a custom mvc widget with a custom image upload-er control and need to decide it quickly whether we should keep in it admin interface or not. Thanks.

0 votesVote for this answer Mark as a Correct answer

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