[Moin-devel] CVS: dist/wiki/data/text HelpOnActions_2fAttachFile,1.2,1.3 HelpOnConfiguration,1.9,1.10
J?rgen Hermann
jhermann at users.sourceforge.net
Tue Mar 5 16:29:03 EST 2002
Update of /cvsroot/moin/dist/wiki/data/text
In directory usw-pr-cvs1:/tmp/cvs-serv23896
Modified Files:
HelpOnActions_2fAttachFile HelpOnConfiguration
Log Message:
Docs for AttachFile action
Index: HelpOnActions_2fAttachFile
===================================================================
RCS file: /cvsroot/moin/dist/wiki/data/text/HelpOnActions_2fAttachFile,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** HelpOnActions_2fAttachFile 22 Feb 2002 20:45:02 -0000 1.2
--- HelpOnActions_2fAttachFile 6 Mar 2002 00:28:07 -0000 1.3
***************
*** 1,7 ****
! /!\ TODO
! * AttachFile action, contributed by Ken Sugino; note that you have to enable this action because of the possibility of DoS attacks (malicious uploads), by adding this to your moin_config: allowed_actions = ['AttachFile']
! * "attachment:" URL scheme allows access to attachments, to get files from other pages use "attachment:WikiName/filename.ext".
! * 'inline:' scheme works like 'attachment:', but tries to inline the content of the attachment into the page; currently knows about "*.py" sources and colorizes them
! * other new linking schemes, like attachment: inline: drawing:
--- 1,37 ----
! == Enabling the AttachFile action ==
! The `AttachFile` action lets a page have multiple attached files.
! Since file uploads could be abused for DoS (Denial of Service) attacks, `AttachFile` is an action that has to be enabled by the wiki administrator. See [wiki:Self:HelpOnConfiguration#file-attachments Configuration of MoinMoin] for details.
! == Creating attachments ==
!
! To create a new attachment, you can either add an attachment link to any page (see below on how to do that), or click on the `AtttachFile` link at the bottom of the page. In the first case, you will see an `Upload new attachment` link after saving the page. Clicking on it will lead you to the upload page, just like directly clicking on the `AttachFile` link.
!
! The upload form consist of three fields, in addition to the file input there are two optional fields, one to specify a MIME type for the file (which will be detected automatically otherwise), the second to store the file under a different name than on your own computer.
!
! An upload will never overwrite an existing file. If there is a name
! conflict, you have to rename the file that you want to upload.
! Otherwise, if "Rename to" is left blank, the original filename will be used.
!
! Any upload or deletion of attachments is reflected on RecentChanges and thus subject to peer review. Unlike page changes, there is no history though, so ''keep a local copy of files'' so you can revert possible vandalism.
!
!
! == Linking to attachments ==
!
! To refer to attachments on a page, use `attachment:filename.ext`; a link of this kind follows all the rules for normal links, i.e. pictures are automatically inlined.
! Do '''not''' use the URL of the `[get]` link you can see on the attachments upload page,
! since these links are subject to change and can break easily on reconfigurations of the wiki.
! To refer to files attached to other pages, use `attachment:WikiName/filename.ext`.
!
! Instead of `attachment:`, you can also use `inline:`, which tries to inline the attachment's content. For pictures there is no difference. For Python sources (i.e. attachments with a `.py` extension), they are shown as syntax-highlighted source displays. For all other files, the behaviour is the same as for simple `attachment:` links.
!
! The third type of link is `drawing:`, explained in the next section.
!
!
! == Editing vector drawings ==
!
! A link looking like `drawing:picturename` will allow you to ''interactively'' edit vector diagrams via the built-in Java applet. The applet will then store two attachments, "`picturename.draw`" and "`picturename.gif`". After you first saved a drawing, the generated GIF picture is displayed for the `drawing:` link. This means that you only need Java enabled for editing, while displaying the results works with any browser.
!
! To edit a drawing after the first save, click on `AttachFile` and use the `[edit]` link that is displayed instead of `[view]` for the `.draw` attachment. Saving a drawing is reflected in RecentChanges.
!
! For details on using the drawing applet, see TWiki:Plugins/TWikiDrawPlugin.
Index: HelpOnConfiguration
===================================================================
RCS file: /cvsroot/moin/dist/wiki/data/text/HelpOnConfiguration,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** HelpOnConfiguration 4 Mar 2002 20:42:20 -0000 1.9
--- HelpOnConfiguration 6 Mar 2002 00:28:07 -0000 1.10
***************
*** 90,91 ****
--- 90,123 ----
special markup for extended WikiName``s `["extended name"]` to get any names
with characters outside the core latin alphabet.
+
+
+ [[Anchor(file-attachments)]]
+ === File attachments ===
+
+ The [wiki:Self:HelpOnActions/AttachFile AttachFile action] lets a page have multiple attached files.
+ Since file uploads could be abused for DoS (Denial of Service) attacks, `AttachFile` is an action that has to be enabled by the wiki administrator. To do this, add "`allowed_actions = ['AttachFile']`" to your configuration file.
+
+ There are also two storage/retrieval models for file attachments:
+ 1. attachments are stored "privately" and can only be retrieved via a CGI GET (via URLs like `http://wiki.net/moin/SomePage?action=AttachFile&do=get&target=filename.ext`).
+ 1. attachments are stored into a directory directly accessible by the web server, and can thus be served directly by the webserver, without any invocation of MoinMoin (leading to URLs like `http://wiki.net/wiki/mywiki/SomePage/attachments/filename.ext`).
+
+ Generally, the second option is preferable[[FootNote(Such a configuration will lead to lower server loads, since you avoid the overhead of a CGI process for every attachment download.)]], but it also requires additional configuration steps, and possibly more rights on the host machine. Because of that, the first option is the default; attachments are stored in the "data" directory, with paths like "`<data>/pages/<pagename>/attachments/<filename>`".
+
+ For the second option, you need to add an `attachments` option to your configuration, which is a dictionary of two values: {{{
+ attachments = {
+ 'dir': 'C:/Moin/share/moin/htdocs/mywiki',
+ 'url': '/wiki/mywiki',
+ }
+ }}}
+
+ `dir` is the file system path to the attachment storage, and `url` is the matching URI to get access to that directory. That directory has to exist and be writable for the webserver, so it can create the necessary directories and files for new attachments. Note that you have to ''manually'' create this directory, MoinMoin will ''not'' create it for you.
+
+ The above example shows a typical configuration for Windows that works for an installation according to the default setup procedure (see HelpOnInstalling/ApacheOnWin32).
+ For UNIX, if you followed HelpOnInstalling/ApacheOnUnix, the necessary configuration will look like this: {{{
+ attachments = {
+ 'dir': '/usr/local/share/moin/htdocs/mywiki',
+ 'url': '/wiki/mywiki',
+ }
+ }}}
+
+ After you have completed the configuration changes, try to create an attachment for WikiSandbox to check for any errors. If you have any permission problems, you will likely see a Python traceback or some error message.
More information about the Moin-devel
mailing list