====== upload Plugin ====== ---- plugin ---- description: Includes file upload into wikipages depending on the user rights author : Christian Moll, Franz Häfner, Randolf Rotta, Matthias Schulte email : christian@chrmoll.de, fhaefner [at] informatik [dot] tu-cottbus [dot] de type : Syntax lastupdate : 2014-01-02 compatible : Adora Belle, Weatherwax, Binky, Detritus depends : conflicts : similar : tags : upload, media downloadurl: https://github.com/lupo49/dokuwiki-plugin-upload/tarball/master sourcerepo : https://github.com/lupo49/dokuwiki-plugin-upload bugtracker : https://github.com/lupo49/dokuwiki-plugin-upload/issues ---- ===== Download and Installation ===== Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. * [[http://studiy.tu-cottbus.de/projektwiki/_media/gruppen:ag_server:produkte:upload.tar.gz|download]] (update: better form handling, "upload as" field) * [[http://www.chrmoll.de/dokuwiki/lib/exe/fetch.php?media=dokuwiki_plugins:upload.tar.gz|the original version by Christan Moll]] ===== Documentation ===== The documentation for the Upload-Plugin can be found at: [[http://studiy.tu-cottbus.de/projektwiki/gruppen:ag_server:produkte:upload_plugin]] ==== Syntax ==== To add the upload form to a wiki page use the following syntax {{upload>[namespace]|[options]}} Namespace can be relative to the actual namespace or one of two keywords. The keyword **@current@** can be used to upload the files into the current namespace. The keyword **@page@** can be used to upload the files into a namespace with the same name as the page. ==== Options ==== **OVERWRITE** let the user choose wether to overwrite existing files or keep the file that is already there. **RENAMEABLE** shows additionally a textfield to rename the file when uploading. The options are separated by | (a pipe), for example: {{upload>:files:}} {{upload>@current@|OVERWRITE}} {{upload>@page@|OVERWRITE|RENAMEABLE}} ==== Features ==== * better handling of submitted form: uses an action plugin to process the form data * correct caching: uses meta-data and the cache_use event to handle the different user access rights and form visibility * nicer fieldset and formatting To display the uploaded files, there are other plugins: * [[plugin:medialist|plugin:medialist]] * [[plugin:filelist|plugin:filelist]] * [[plugin:filelisting|plugin:filelisting]] has filter/search and minimal options, a good start. ===== Discussion ===== I installed it on "DokuWiki Release 2009-02-14b" using Plugin manager, it shows the Upload box, but when I click "upload", nothing happens - the selected file isn't uploaded. When I change the Form action in the source code to be "lib/exe/mediamanager.php", it uploads the file but then shows the Media manager instead of the original page...\\ --- //[[marg@rz.tu-clausthal.de|Christian Marg]] 2010/01/05 10:31// I installed the application on the latest stable release, however I have no upload button anywhere added to my wiki sites. There doesn't seem to be a way for users to upload. \\ --- //Chad 5 Jan 2010 12:33 PM GMT -4// Should be solved in the current version. --- // R.Rotta 9 Feb 2011// Nice plugin. Thank you. However, the link that is used in ''
'' (file syntax.php, line 39) should be generated with "''wl($ID)''", not "''DOKU_BASE.'doku.php?id='.$ID''", because ''wl()'' takes care of the various dokuwiki [[config:userewrite|rewriting]] possibility. \\ --- [[user>schplurtz|schplurtz]] //2011/02/18 17:15// Done. --- [[user>lupo49|Matthias Schulte]] //2014/01/02 13:02// In 2012-01-25 "Angua", the RENAMEABLE-function doesn't work for me. The files are uploaded with their initial filename. --- [[user>Kraligor|Kraligor]] //2012/02/24 12:14// Lösung: Replace in action.php in Line 70 $_POST['id'] = $_POST['new_name']; in $_POST['mediaid'] = $_POST['new_name']; //- hhoch3 4. May 2012// Fixed. --- [[user>lupo49|Matthias Schulte]] //2014/01/02 18:00// In 2012-01-25 "Angua" and before you get a permissionmistace which disappears when you log in. (Idea of plugin is great.) --- [[user>deshi]] //2012-04-13// Added to compatibility info box. --- [[user>lupo49|Matthias Schulte]] //2014/01/02 18:00// ==== Shows alert when not logged in ==== Using "Weatherwax," when not logged in, an alert bar shows on the start page when this plugin is enabled. Also experiencing the same bug reported from "ajfre." Have to touch the config files to show the created page. Love the plugin otherwise! --- [[user>Mojangsta|Mojangsta]] //2014/01/17 10:07// Using Release 2013-12-08 "Binky", when not logged in, an alert bar shows on top of the start page. If the plugin is disabled all is ok. Thanks Konrad 23-01-2014 With "Binky" installed, I get alert bar with message "Upload failed. Maybe wrong permissions?" for user who is not logged in. All OK when user is logged in. Touching /conf/local.php makes no difference - alert bar is still there (shows up just below the 'Trace' on the new default dokuwiki template, even on pages that do not contain any code for upload plugin. --- [[user>charles.minto|charles.minto]] //2014/01/24 01:37// You may fix the code this way: ''action.php'' around Line 62 \\ ''if($AUTH < AUTH_UPLOAD) {''\\ __''if($AUTH < AUTH_UPLOAD && $_FILES['upload']['tmp_name']) {''__ >Just a note to verify that the code above fixes the problem that I reported.--- [[user>charles.minto|charles.minto]] //2014/03/28 14:54// >> Works in hrun, too. --- [[user>kaimartin|KaiMartin]] //2015-03-11 21:02// >>> This patch is still necessary in detritus. --- [[user>KaiMartin|KaiMartin]] //2015-10-15 19:02// ==== Needs manual refresh after creation of a new page ==== In Dokuwiki Release //Ponder Stibbons//, the plugin is not rendered after creating a new page (only a blank page is displayed). The page has to be refreshed once in order to get it rendered. Removing $controller->register_hook('PARSER_CACHE_USE', 'BEFORE', $this, '_hook_function_cache'); in //action.php// seems to make the problem disappear. But I am not that familiar with Dokuwiki and can't tell if that causes any unwanted side effects.. --- sieber //2014/07/10/// > I can confirm, that this glitch also shows in Detritus. A simple refresh does not suffice to get a correctly rendered page. You have to make a small change and save. This seems to reset the cache and everything is fine from thereon out. (Have not tried the fix, yet) --- [[user>KaiMartin|KaiMartin]] //2015-10-14 14:06//