MediaLibraryHelperGetDirectUrl Method |
Returns a direct URL to the media file.
Namespace: CMS.MediaLibraryAssembly: CMS.MediaLibrary (in CMS.MediaLibrary.dll) Version: 13.0.131
Syntax public static string GetDirectUrl(
MediaFileInfo mediaFile
)
Parameters
- mediaFile
- Type: CMS.MediaLibraryMediaFileInfo
Media file for which the URL is generated.
Return Value
Type:
StringExceptions Exception | Condition |
---|
ArgumentNullException | mediaFile is null. |
Remarks
Generates various URL types depending on the media library location:
URL | Location |
---|
~/mediaLibraryFolder/filename.extension | Media file is located in a local media library on the current site. |
http://domain.com/mediaLibraryFolder/filename.extension | Media file is located in a local media library on a different site. |
http://CDN/mediaLibraryFolder/filename.extension | Media file is located in a media library stored in CDN. |
~/getmedia/fileGUID/fileName.extension | Media file is located in a media library which is located outside of the CMS application on the current site. |
http://domain.com/getmedia/fileGUID/fileName.extension | Media file is located in a media library which is located outside of the CMS application on a different site. |
See Also