Uploading non image files to the wiki

From Docswiki
Jump to navigation Jump to search

For security reasons, the 'Upload file' functionality of the wiki only lets you upload images with .png, .gif, .jpg and .jpeg extensions. This can be a bit of a pain when you want to link to say a tar file containing some input for a tutorial you're writing.

To get around this, you can upload the files to the webserver itself, put them somewhere accessible, and put a link in your tutorial. Here is a quick step-by-step:

Compress your files

Lets say I want to upload the content of the directory HBONDMATRIXtest. You should always compress your files as we have limited space on the webserver - so you want to do something like this:

tar cvfj HBONDMATRIXtest.tar.bz HBONDMATRIXtest/

Copying your files to the webserver

You should have access to the webserver if you have access to this wiki, and so you can just use scp to send your files over:

scp HBONDMATRIXtest.tar.bz www-wales2021.ch.private.cam.ac.uk:

The password you use should be your AD password.

NOTE: you MUST have the 'private' in there or it'll end up on an obsolete machine!

Moving your files into a publicly accessible location

You home directory on the webserver is not accessible from the internet, so you need to move your files. To do this, you will be using sudo - so be careful! First - we ssh into the machine:

ssh www-wales2021.ch.cam.ac.uk

Now we make a directory in the website root for our files - I called mine 'chris':

sudo mkdir /var/www/chris

If you have problems with using sudo - you might not have the correct permissions - ask me (Chris W) or David to sort you out.

Then we want to move the files we just uploaded to that directory:

sudo mv HBONDMATRIXtest.tar.bz /var/www/chris

Ok! That file should now be publicly accessible. To check, you can point your browser at http://www-wales.ch.cam.ac.uk/chris/. Happily, the file is there!

Linking the file in your tutorial/article

Finally, the easy bit - to link the file, you simply use syntax like this:

You can find the example input and output files [http://www-wales.ch.cam.ac.uk/chris/ here]

Which (without the nowiki tags) results in this:

You can find the example input and output files here

Done! :D

--Csw34 17:17, 1 May 2012 (UTC)