Try our conversational search powered by Generative AI!

Episerver 11: Media library - a report of all the files

Vote:
 

Hi,

Is there any ”easy” way to export a list of all files that are published on the website (pdf, word, excel, ppt)?

Or a way to find the total number of files? 

Many thanks.

And by the way - I´m not a system developer.

Regards,
Anette

#307453
Edited, Aug 25, 2023 7:37
Vote:
 

Hi,

If you still require this advice and from what has been mentioned,  This could be done by developing a custom Optimizely Add on (https://docs.developers.optimizely.com/content-management-system/docs/adding-and-configuring-menu-items)  that lives in the CMS that will retrieve the files in your CMS based on specific file sizes which you require. The number of files with basic information about the specific media file can then be exported to a CSV file which is downloaded to the computer for data reference.

Hope this helps, if you need any further info, please let me know

#312825
Nov 20, 2023 21:54
Vote:
 

Thank you Anil Patel!
Kind regards, Anette

#312874
Nov 21, 2023 6:00
Vote:
 

It's not neccessery to write code to accomplish this.

Option 1: SQL

If you have access to the database, or you want to use my SQL-addon.

Get list of all PDF-documents

SELECT c. pkId, cl.UrlSegment FROM tblContent c, tblContentLanguage cl 
WHERE c.pkId = cl.fkContentID AND fkContentTypeID IN
(
	SELECT pkId FROM tblContentType WHERE ContentType = 2
)
AND UrlSegment LIKE '%.pdf'

Or just the total number of PDF-documents

SELECT COUNT(c. pkId) FROM tblContent c, tblContentLanguage cl 
WHERE c.pkId = cl.fkContentID AND fkContentTypeID IN
(
	SELECT pkId FROM tblContentType WHERE ContentType = 2
)
AND UrlSegment LIKE '%.pdf'

Update the file extension on the last line to list different file types.

Or you can count all file types, grouped by extension like this.

SELECT 
   FileExtension, COUNT(*) AS FileCount
FROM 
   (SELECT 
       RIGHT(UrlSegment, CHARINDEX('.', REVERSE(UrlSegment)) - 1) AS FileExtension
   FROM 
       tblContent c, tblContentLanguage cl, tblContentType ct
   WHERE 
       c.pkID = cl.fkContentID AND c.fkContentTypeID = ct.pkID AND ct.ContentType = 2 AND cl.UrlSegment LIKE '%.%') AS _
GROUP BY
   FileExtension
 ORDER BY
    FileCount DESC

Should show something like this:

Option 2: Media report plugin

You could test this plugin.

#312882
Edited, Nov 21, 2023 8:09
* 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.