« Aalto « ELEC « AS

PmWiki documentation (local copy)

Images & other attachments

The easiest way to upload a file or attach an image to a page is to write Attach:YourFileName.ext in the edit box of the page and follow the resulting link to upload the file. If it's a JPEG, GIF or PNG image it'll automatically be displayed. Otherwise it'll be a link to the uploaded file.

An uploaded file will belong to the same group as the page to which you attached it. In order to see a list of files belonging to a group, follow the "Attachments" link at the bottom of a page belonging to that group. That page will also provide links for replacing uploaded files with newer versions and for deleting them.

You need to define a name for the file as you upload it; this need not be the same as the name on your local machine. Uploading a file with the same name as a previously uploaded file in the same group will mark the previous file as deleted. Do note that only an admin can really delete a file, editors can only mark files as being deleted, which makes them inaccessible to those without edit access to the group.

Access control works the same way for uploaded files as it does for pages, in that if you're allowed to read pages that belong to a group you're also allowed to access its uploaded files.

You can get a listing of all the attached files from a group using the (:attachtable:) command. This has quite a few options that are detailed in its documentation, but the following should work for most purposes:

(:attachtable actions=none data=size,modtime -deleted :)

Image resizing

When you upload an image file (of almost any type) the site will attempt to make two smaller versions of the file: one thumbnail that's at most 100x100 pixels and one "normal" size that's at most 300x600 pixels. It's recommended that you don't include larger images in pages, as they may break the layout. Instead, you should use one of the resized images as a link to the original.

If the image you're uploading is a JPEG, GIF or PNG, these smaller versions will be of the same format as the original. Their filenames wil be as follows, assuming that you've uploaded a file with the name image.jpg :

image.orig.jpg — the actual file you uploaded
image.jpg — the image, resized to at most 300x600 pixels
image.small.jpg — the thumbnail, resized to at most 100x100 pixels

If the image has a different type (say, BMP or TIFF), these smaller versions will be PNG images. Their filenames wil be as follows, assuming that you've uploaded a file with the name image.tiff :

image.tiff — the actual file you uploaded
image.png — the image, resized to at most 300x600 pixels
image.small.png — the thumbnail, resized to at most 100x100 pixels

For example, to use a thumbnail image as a link to a larger image, you may use the following:

[[ Attach:image.orig.jpg | Attach:image.small.jpg ]]

More on placing images on pages...

File extensions

The site should automatically detect what type of file you're uploading, and serve it correctly. The system isn't perfect, so please inform the admin if a file is served with an incorrect MIME type.

For reasons of speed, if a filename has one of the following extensions, the file type won't be determined from the contents of the file but just the extension. Howewver, the uploads page will still show the actual MIME type of the file.

Imagesgif, jpg, jpeg, png, bmp, ico, wbmp, psd
Audiomp3, au, wav
Moviempg, mpeg, mov, qt, wmf, avi
Webhtm, html, css, fla, swf
Archivezip, gz, tgz, rpm, hqx, sit
Executableexe
Documentpdf, txt, rtf, ps, ai, eps, tex, dvi, doc, ppt, xls, mdb