Loading...
 
Development

Development


Cleanup for img/wiki_up and Proposed Structure

posts: 28 United States

First, a question (both questions assume you have turned "ON" the image uploads and attachments options for wiki pages)...

Is there any sort of cleanup script or methodology for dealing with orphaned files in img/wiki_up?

I know when you upload a file as part of writing a page (an attachment, if you will) it gets stored there as the filename you upload it as. I was wondering what happens when the page gets deleted? I suspect nothing.

Second question...

Without doing manual upkeep, there is a very real potential for filename conflicts in img/wiki_up. Has there been discussion about modifying the attachment scripts to create subdirectories based on the page ID under img/wiki/up ?

How I utilize Tiki is as a departmental CMS, which includes numerous process documents (MOPs) that describe standard ways to do tasks, and also include numerous screenshot examples. Given uncreative people, I can see multitudes of "screenshot1.jpg" conflicting with each other. Having a separate subdirectory for each page that contains an attachment would eliminate this, and still allow folks to use those images in other pages.

A more sophisticated clean-up tool would be required, but then I don't think we have one at all at the moment, that could look for files with deleted pages, and determine if any other pages reference them.

Any thoughts?

Mike.

posts: 4642 Japan

> First, a question (both questions assume you have turned "ON" the image uploads and attachments options for wiki pages)...
>
> Is there any sort of cleanup script or methodology for dealing with orphaned files in img/wiki_up?

There is a "Removed unused pictures" link on the wiki admin page, but from what people say, it isn't too smart and tends to delete images still being used. I guess it's on the right track but apparently needs to be improved.

> I know when you upload a file as part of writing a page (an attachment, if you will) it gets stored there as the filename you upload it as. I was wondering what happens when the page gets deleted? I suspect nothing.

Right.

> Second question...
>
> Without doing manual upkeep, there is a very real potential for filename conflicts in img/wiki_up. Has there been discussion about modifying the attachment scripts to create subdirectories based on the page ID under img/wiki/up ?

There's nothing built-in. The solution has to be a consistent naming system for page authors, like ))PageOne_image1.png,PageOne_image2.png((, or with a timestamp, which I think somebody might have built into the image upload script at some Tiki site.

> How I utilize Tiki is as a departmental CMS, which includes numerous process documents (MOPs) that describe standard ways to do tasks, and also include numerous screenshot examples. Given uncreative people, I can see multitudes of "screenshot1.jpg" conflicting with each other. Having a separate subdirectory for each page that contains an attachment would eliminate this, and still allow folks to use those images in other pages.
>
> A more sophisticated clean-up tool would be required, but then I don't think we have one at all at the moment, that could look for files with deleted pages, and determine if any other pages reference them.

The existing "Remove unused pictures" might be a starting point for cleaning the wiki_up directory. And it doesn't seem like it'd be too hard to add something to the image upload script, like the way Firefox Snapshot screenshot files get a (Unix?) timestamp added to the name.

Personally, I like the way wiki_up images have human-readable names and wouldn't want to lose that, but adding the timestamp would be good.

-- Gary

posts: 28 United States

> > Second question...
> >
> > Without doing manual upkeep, there is a very real potential for filename conflicts in img/wiki_up. Has there been discussion about modifying the attachment scripts to create subdirectories based on the page ID under img/wiki/up ?
>
> There's nothing built-in. The solution has to be a consistent naming system for page authors, like ))PageOne_image1.png,PageOne_image2.png((, or with a timestamp, which I think somebody might have built into the image upload script at some Tiki site.
>
> The existing "Remove unused pictures" might be a starting point for cleaning the wiki_up directory. And it doesn't seem like it'd be too hard to add something to the image upload script, like the way Firefox Snapshot screenshot files get a (Unix?) timestamp added to the name.
>
> Personally, I like the way wiki_up images have human-readable names and wouldn't want to lose that, but adding the timestamp would be good.

I like the filenames as they are too, I would just like a way to differentiate filenames associated with page A with similar filenames associated with page B. I don't think a timestamp would do it, but either prefacing the filename with the post ID or creating a whole subdir for that post ID would.

I'll take a look at Rick's methods and see how he approaches it.

Thanks guys!

Mike.