There are three ways how files can be uploaded into a media library:
|•||By means of the administration interface|
|•||On the live site using the Media gallery or Media file uploader web parts|
|•||Externally, directly into the file system - e.g. via FTP|
In the following examples, you will learn how to add files into media libraries via the administration interface, on the live site and using FTP.
Uploading files via the administration interface
If you choose to Edit () a media library in CMS Desk -> Tools -> Media libraries, you can manage files in the library on the Files tab.
1. It is a good idea to keep your files organized in folders within the media library. To create a new folder, click the New folder button in the top left corner of the page.
2. Enter the name of the folder, e.g. pictures, and click OK.
3. The folder is now created. You can upload files into the selected folder by clicking the New file button.
4. A dialog appears, letting you upload the file. Just select the right folder and the file to be uploaded, then click the Open button.
5. Now if you go to the site folder in your file system, you will find the media library under the media folder, as you can see the screenshot below. The location of the folder may be customized as described here.
The Media gallery web part has the following two properties enabling on-site file upload:
|•||Allow upload - enables on-site upload of files|
|•||Allow upload thumbnail - enables on-site upload of file previews|
If these properties are enabled, the controls highlighted in the screenshot below will be displayed in the web part, letting users upload files and thumbnails:
Files can also be uploaded externally, without any use of Kentico CMS administration interface or on-site web parts, e.g. using FTP. To do this, you simply need to copy the files into the appropriate folder of the media library.
1. For the purposes of this example, try uploading another file into the pictures folder by copying it using Windows Explorer or any other file manager.
2. If you go back to the Media library administration interface, you will see the file present in the list. As you can notice, this file is marked with the warning () icon indicating that the file has not been imported yet. This means that the file has not yet been registered in the database. Such files can not be used on the site and have to be registered first. This happens only to externally uploaded files, files uploaded via the administration interface are registered in the database automatically.
To register the file, you have to click the Import button, which creates the file's record in the database. Please note that the files are not physically copied into the database, they remain in the file system only and a record linking to the physical file is created in the database.
Multiple files can also be imported conveniently as a batch. See Batch operations in the Files and folders management topic for more details.