Description and Usage
Allow authors to upload files by simply dropping them into the edit or upload form.
Screenshot: from 5 files dropped, 2 already uploaded, 1 currently uploading and 2 refused/failed.
The recipe enables multiple asynchronous uploads. Authors can pick files from their file managers and drop them into the wiki page (edit or upload form). They can drop single or multiple files at once, and start again.
- Before uploading, files that are too large or with unacceptable extensions will be discarded.
- The files will be immediately and parallelly uploaded to the wiki, without the author having to press a button, leave the edit form or to reload the page.
- The upload progress is shown, with files already uploaded, currently uploading or failed.
- After a successful upload, a link allows the insertion of the
Attach:File.jpgmarkup into the wiki edit area, exactly like the buttons of the edit toolbar.
- If PmWiki renamed the file to a new name, for example lowercase extension, clicking on the link will insert the new filename in the page.
- After a failed upload, a tooltip title on the filename shows the reason for the failure.
- copy the file "ddmu.php" to your pmwiki/cookbook directory
- copy the folder "ddmu" to your pmwiki/pub directory
- add to config.php such a line:
$DDMUEnableDropzone = 1;# Enable drop zone. The default DDMU uses the whole page as a drop zone. With this line, you can use only the file list as a drop zone. This allows drag and drop of text in the edit area which otherwise is blocked.
$EnableBrowseDDMU = 1;# Enable a drop zone in "browse" mode near the top of the page, and not only in "edit" or "upload" modes (requires the drop zone to also be enabled). This can be enabled on specific pages or groups.
$DDMUEnableQueue = 1;# Enable upload queue.The default DDMU uploads all dropped files in parallel, which may in some cases break the RecentUploads recipe. With this line, all files are uploaded one after another.
For an international wiki, the following strings can be translated:
'ULuploading'=>"uploading...", 'ULunknown_error'=>"unknown error", 'ULdropzone_innerHTML'=>"Drop files to upload: ", "Login successful, you can now upload."=>"Login successful, you can now upload.",
To enable a drop zone in browse mode, you need to have both variables $DDMUEnableDropzone and $EnableBrowseDDMU enabled. In that case the drop zone will appear at the top of the #wikitext element with the content of the browsed page (the main element from the skin). You can change the appearance the drop zone by defining in local.css the styles for the
div#DDMU element. You can change the location of the drop zone by adding anywhere in the page or in the sidebar/header/footer a
(:div id=dropzone:)...(:div:) element, in that case the drop zone will be appended to the end of that element (so you can have some custom text above the actual drop zone).
- Firefox 4 and newer, Chromium/Google Chrome, Midori, Safari work.
- Microsoft Internet Explorer version 10 works. Earlier MSIE versions do not.
- Opera version 12 kind of works (if many files are dropped at once, only one of them is uploaded, but you can drop single files as many times as needed).
- To upload files, authors need "upload" permissions, if they don't have them, the uploads will fail. Clicking on the failed filename will bring up a login form, allowing the authors to enter their passwords.
Change log / Release notes
- 20170814 Add $EnableBrowseDDMU, allow editors to drop files in "browse" mode.
- 20120813 Corrected $RecipeInfo tag to work with RecipeCheck, suggested by Antony Templier.
- 20120725 Added $DDMUEnableQueue.
- 20120313a The icons next to the file links are now preloaded and cached.
- 20110826, 20110826a Added $DDMUEnableDropzone.
- 20110820 Enabled login form if no upload permissions. Minor style changes.
- 20110819 First public release, ready to be tested.
- Cookbook /
- FileAttachList Adds a Ajax list of quickly attachable files to the edit page (Stable)
- MultiUpload Upload multiple files at once by packing them in a zip archive & extracting them on the server (beta)
- PasteImgUpload Upload an image by copying and pasting in the editing area directly.
- UploadForm Alternative file upload form using
- PmWiki /
- UploadsAdmin Administration of PmWiki uploads
- Recipe written and maintained by Petko (5ko [snail] 5ko [period] fr). The package includes the Unverse.js library by John Goodman.
- If this recipe helps you or saves you time, you can help support its continued development by ♥ ..
See discussion at DragDropMultiUpload-Talk