22401 Posts in 6852 Topics by 2748 members
Page: 1 2
|Go to End||Next >|
11 December 2012 at 12:50pm
I manage a few sites which are quite old, and where the assets folder contains over a gig of files which the client has been uploading into for years.
What i'm looking for is a module which lists all the files in the assets area, the file sizes, date uploaded, and how many times this file is used (eg, linked to either through has_one with a database, or linked into the html content of a page)
Then, either through script, or manually, the client would be able to delete their old files, and make the whole site a lot easier to manage.
Does anyone know if such a module exists?
13 December 2012 at 1:50am
I haven't used this so I'm not sure if it does exactly what you want but here's a link anyway.
14 December 2012 at 4:01am
I know SS3 does a much better job at tracking backlinks for files. I'm getting to this point with one of my clients SS2.x and dreading tackling it because I need to move it to a new host.
14 December 2012 at 5:10am
SS3 seems to track images used in UploadFields but in HTMLEditorFields SS3 images and files are inserted as HTML with their URLs. It would be good if these were replaced with database IDs like how page links are done so it had a means of saying if / where / how often an image was used.
14 December 2012 at 5:32am
I'm just going off the top of my head so it's totally hacky, but I guess you could do a custom controller that loops through all file objects, then searches all the content fields (on Page + any custom DataObjects with HTML Content) for a version of the $Name field stripped of the extension. Uou could then check and relations as well. If the search returns no results it deletes the object. Not an efficient function but theoretically you'd only run it occasionally, and probably manually.
Like I said hacky, but hey I'm writing this while eating lunch
14 December 2012 at 9:37am
thanks for the comments, unfortunately these sites are both in ss 2.3 or 2.4 - they're old and big, making upgrade, or managing the files a bit tricky.
zenmonkey, that's the kind idea I was thinking of, was just wondering someone else had already done the coding!
14 December 2012 at 9:51am
Well I was thinking of throwing something like that together this weekend. I'm moving a clients site from shared hosting (DreamHost) to a Media Temple VS, if I don't have to move the chuff it'll be much better. If I'm successul I'll post my code. My worry is that on shared hosting that many calls may choke hard limits on memory.
14 December 2012 at 9:58am
zenmonkey - would be keen to here how you get on!
Could probably just start by getting the first 100 files or so, and finding any links batch by batch, or else like you say it could overload stuff if there are thousands of files searching through thousands of pages...
Page: 1 2
|Go to Top||Next >|