JSPWiki file attachments#
RefactorMe (this page is very outdated)
JSPWiki has been able to support file attachments since version 2.0.0.
Stuff that is still missing, and should be done:
- See a shortened attachment list on the editor page.
- Add attachments to RecentChanges and reference lists. (This should actually be quite easy).
- I wrote up a bit of instructions in WikiAttachments - that page is going to end up in the distro (but was forgotten from 2.0.0).
- Minor improvements: the attachments style should probably specify a slightly different background color to better separate the table from the page body. The "Attachments:" text should be within the div, or a table title.
The current code always sets the header Content-Disposition: attachment; filename=.... This causes a browser to always ask what to do with the file, even for text/html. If this is changed to Content-Disposition: inline; filename=... (in accordance with rfc 2183) the browser trys to show it in the usual way first (tested with Mozilla 1.2 and IE 6) while still presenting the correct filename if the user chooses to save the page. I would very much prefer the second solution.
(AttachmentServlet.java, line 127 :)
Ah, excellent. Thanks for the tip! (There is actually also a bug in IE4 I think, where you gotta spell "attachment" as "attachement" or IE will misinterpret the data...)
Fixed in 2.0.1.
Hm. Mozilla 1.2.1 seems to want to save the incoming file as "attach", which is the servlet name. This does not sound like a good idea to me.
-- JanneJalkanen, 21-Feb-2002.
Question : how to simply display attached pictured.#
In a page : AvailablePictures, I attached
an image : xp-icon.jpg
Is there a simpler way to display it, in the base page, or any page, than using the absolute address, as in:
Just say [xp-icon.jpg], or if you're on some other page, [AvailablePictures/xp-icon.jpg]. The latter form works in any place.
Note that you will have to have enabled .jpg-images as inline images.
Thanks Janne. --AlainRavet