function placeFiguresOnWiki (dirnow,dirmat)

%% prepare operations
basepath = 'p:\mctools\matlab';
cd(basepath);mcsettings;cd(dirmat);

rundir   = fileparts(mfilename('fullpath'));
addpath(rundir);
addpath([rundir filesep 'code']);

%% initialise WIKI settings
service    = ConfluenceSoapServiceService('http://wiki.deltares.nl');;
spacekey   = 'MCT';

%% get page information
pagetitle  = 'McTools homepage';
           page       = getPage(service, activateService(service,'Mark van Koningsveld', 'Rd4hD'), spacekey, pagetitle);

fns = dir([dirnow '\*.png']);
for i = 1 : length(fns)
    clear in2;
    in2.contentType = 'png';
    in2.fileName    = fns(i).name;
    in2.pageId      = page.id;
    in2.title       = page.title;
    in2.url         = page.url;

    handle = fopen([dirnow '\' fns(i).name]); binarydata = fread(handle); fclose(handle);

    addAttachmentReturn = addAttachment(service,activateService(service,'Mark van Koningsveld','Rd4hD'),page.id,in2,base64encode(binarydata));
end

web   ('http://wiki.deltares.nl/display/MCT/McTools+homepage');

