Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » File picker
Re: File picker [message #377 is a reply to message #375] Wed, 08 November 2006 08:12 Go to previous messageGo to previous message
AJM is currently offline  AJM
Messages: 2363
Registered: April 2006
Location: Surrey, UK
Senior Member
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.


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: std.list3 problem
Next Topic: std.list3 passing middle table to child form
Goto Forum:
  


Current Time: Sun Oct 06 12:21:49 EDT 2024

Total time taken to generate the page: 0.01216 seconds