You keep switching between the filepicker and fileupload patterns, which is very confusing. They are different patterns to do different things, and so the parameters are different.
To create a filepicker the component script needs to look something like this:
<?php
$screen = 'person.filepicker.screen.inc'; // file identifying screen structure
$subdir = 'whatever'; // subdirectory
$filetype = 'document'; // file types to process
require 'std.filepicker1.inc'; // activate page controller
?>
At the moment the script std.filepicker.inc does not recognise the file type of 'document', so you will have to change it as follows:
switch ($filetype) {
case 'image':
$filemask = "(\.gif|\.jpg|\.png|\.bmp)$";
break;
case 'document':
$filemask = "(\.pdf|\.doc)$";
break;
default:
$errors[] = getLanguageText('sys0059', $filetype); // "Unknown filetype ($filetype)"
} // switch
I am going to change this in the next release so it will be easier.