Wiki source code of Attachments
Last modified by superadmin on 2026/10/14 18:26
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | A Page can hold files as attachments, which can then be linked or displayed from the content of any Page. You [[attach a file>>doc:documentation.xs.user.attachments.attach-file.WebHome]], [[move or rename an attachment>>doc:documentation.xs.user.attachments.move-attachment.WebHome]] and [[delete an attachment>>doc:documentation.xs.user.attachments.delete-attachment.WebHome]] from the [["Attachments" tab>>doc:documentation.xs.user.base.page.view.attachments-tab.WebHome]] of the Page. | ||
| 2 | |||
| 3 | == Versions == | ||
| 4 | |||
| 5 | Attaching a file under the name of an existing attachment does not replace it: it adds a version, and the earlier versions stay available in the history of the attachment. Deleting is reversible as well, for as long as the Page keeps a version from before the deletion: see [[Restore a Deleted Attachment>>doc:documentation.xs.user.attachments.restore-attachment.WebHome]]. | ||
| 6 | |||
| 7 | == Limits == | ||
| 8 | |||
| 9 | The maximum size of an attachment comes from the ##upload_maxsize## preference, which the [[administrator sets per wiki>>doc:documentation.xs.admin.attachments.maximum-size.WebHome]] and which allows 100 GB in a standard installation. The administrator can also [[restrict the mimetypes>>doc:documentation.xs.admin.attachments.restrict-mimetypes.WebHome]] that may be uploaded, for a whole wiki or for a set of Pages. | ||
| 10 | |||
| 11 | == Links to an Attachment == | ||
| 12 | |||
| 13 | An attachment is addressed relative to the Page holding it, so a link or an image can also point at an attachment of another Page: see [[Link to an Attached File or Image>>doc:documentation.xs.user.attachments.link-attachment.WebHome]]. Those references are indexed, so a Page displaying an image attached to another Page shows up in that Page's [[backlinks>>doc:documentation.xs.user.base.page.linking-references.WebHome||anchor="HBacklinks"]], and they are rewritten when the attachment is [[moved>>doc:documentation.xs.user.attachments.move-attachment.WebHome]]. | ||
| 14 | |||
| 15 | == Attaching Without Leaving the Editor == | ||
| 16 | |||
| 17 | A file does not have to be attached before it is used: the [[default WYSIWYG editor>>extensions:Extension.CKEditor Integration.WebHome]] attaches it to the Page being edited as part of inserting it. Its [[image dialog>>extensions:Extension.CKEditor Integration.WebHome||anchor="HImageAttachments"]] uploads the file you pick and inserts it in one go, and its [[link dialog>>extensions:Extension.CKEditor Integration.WebHome||anchor="HWikiLinks"]] does the same from the "Upload" tab it shows once the target type is set to "Attachment". In the image dialog, uploading is one tab among several: it opens on a gallery of the images already attached to the Page, from which you [[insert one without uploading anything>>doc:documentation.xs.user.attachments.insert-image-attachment-gallery.WebHome]]. Files dropped over the editing area are attached as well. | ||
| 18 | |||
| 19 | The [[BlockNote editor>>doc:documentation.xs.user.base.page.edit.blocknote-editor.WebHome]], where an administrator has installed it, attaches a file the same way when you [[insert an image>>doc:documentation.xs.user.base.page.edit.blocknote-editor.insert-image.WebHome]] and click "Upload". [[Inserting a link>>doc:documentation.xs.user.base.page.edit.blocknote-editor.insert-link.WebHome]] points at an attachment that is already there. |