{AutoAttachPubFiles}
functionality with a batched update - so you can upload
(ftp, drag&drop etc) images into Foswiki's pub area, and then tell Foswiki to
update the attachments to all your topics.
This will allow you to use viewfile
(which will refuse to serve files not in
the topic Meta), SEARCH for attachments, use DBCacheContrib & DBCachePlugin,
and use any other functionality that relies on the topics containing Meta
registration of attachments (as are made when attaching through the web UI).
Doing this may provide a speed advantage as it will remove the need for Foswiki
to scan the requested topics' attachment directory if the
{AutoAttachPubFiles}
is enabled. In fact, this plugin actively disables this
flag as it becomes redundant by the REST handler and moreover hurts overall
performance.
This plugin is currently the only way to support auto attachments when using
the PlainFile Store.
Also, it will (optionally) remove attachment references to files that no longer
exist in the topic's attachment directory.
Warning: because Foswiki does not deal well with attachments with special
characters (or even spaces) in them, these files will be ignored on update.
cd foswiki-dir/bin; ./rest /UpdateAttachmentsPlugin/update topic=Sandbox.WebHome
Parameter | Description | Default |
---|---|---|
topic |
set the current web.topic location where to perform the handler | Main.WebHome |
mode |
mode of operation:
|
web |
list |
a comma separated list of topics to be inspected; this sets the mode to topics automatically |
|
hide |
Specify if the "hidden" attribute should be assigned for new attachments. (Status of existing attachments is not changed). |
$Foswiki::cfg{Plugins}{UpdateAttachmentsPlugin}{AttachAsUser}
- defaults to the unknown user. To reset the attributed user for attachments that already exist, touch
the files in the attachment directory.
$Foswiki::cfg{Plugins}{UpdateAttachmentsPlugin}{RemoveMissing}
- will remove attachment references in a topic that no longer exist
$Foswiki::cfg{Plugins}{UpdateAttachmentsPlugin}{Debug}
- to see what topics are updated (edit LocalSite.cfg by hand to add this setting).
$Foswiki::cfg{Plugins}{UpdateAttachmentsPlugin}{AttachFilter}
- Regular expression that filters common files that should never be attached to a topic.
$Foswiki::cfg{Plugins}{UpdateAttachmentsPlugin}{HideAttachments}
- Boolean default for the hide attribute on new attachments.
$Foswiki::cfg{Plugins}{UpdateAttachmentsPlugin}{AttachmentComment}
- String that is set as a comment for each new attachment.
$Foswiki::cfg{AutoAttachPubFiles}
(Foswiki 1.x) or $Foswiki::cfg{RCS}{AutoAttachPubFiles}
(Foswiki 2.x). The plugin will do so automatically if enabled.
configure
, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Author(s): | Foswiki:Main.SvenDowideit - http://fosiki.com a WikiRing founding partner Foswiki:Main.GeorgeClark - revised for Foswiki 1.1 Foswiki:Main.MichaelDaum - rewrite and general code cleanup |
Change History: | |
3.13: | Foswikitask:Item14178: Bogus method of aliasing core functions, crashes on Foswiki 1.x. |
3.12: | Foswikitask:Item13543: Configure options for hide attachments, and attachment comment. Fix several other minor bugs. |
3.11: | Foswikitask:Item13540: Update for utf-8 UNICODE core. Fix several minor bugs. |
3.10: | Foswikitask:Item13001: fully specify rest security |
3.01: | Foswikitask:Item12839: require authentication when calling the REST handler |
3.00: | Foswikitask:Item12891: general code cleanup; added modes to update individual topics (Foswiki:Main.MichaelDaum); Foswikitask:Item11844: exclude a few well known auto-generated attachments and thumnails |
2.0.2: | Foswikitask:Item10630: Config.spec really is necessary |
2.0.1: | Foswikitask:Item10630: remove unnecessary files from manifest |
2.0: | Foswikitask:Item10196: correctly handle dot prefixed files |
2.0rc: | Foswikitask:Item9322: Update for version 1.1 of Foswiki |
20 Feb 2009: | Port to Foswiki |
December 2007: | add AttachAsUser |
November 2007: | Initial release |
Dependencies: | None |