[dev] FileUpload Class

Vijay Mahrra vijay.mahrra at es.easynet.net
Fri Mar 21 12:52:58 PST 2003


Hello All,

I am fairly new to the group, so I'm not sure if this is the correct way to go 
about things.  Never-the-less, this is a class I have written for a module I 
am working on to manage images, which I hope could be of use, as I would very 
much like to give something back to the horde development community.

Regards

Vijay

This is some example code to insert into your horde calling script:

// draw an upload form
$form = FileUpload::uploadForm(1,'','','','left');
if (PEAR::isError($form)) {
     $notification->push($form->getMessage(), 'horde.error');
} else {
     // display the files before processing
     FileUpload::displayUploads('','before processing','left');

     // set the parameters for processing
     $tmp_folder = '';
     $vfs_folder = '/tmp/test';
     $valid_mime_types = array('image/jpeg','image/gif');
     $invalid_mime_types = array('application/');
     $allow_empty = false;
     $keep_files = false;
     $tmp_prefix = 'img';

     $_FILES = 
&FileUpload::processUploads($tmp_folder,$vfs_folder,$valid_mime_types,$invalid_mime_types,$allow_empty,$keep_files,$tmp_prefix);
     if (PEAR::isError($_FILES)) {
         $notification->push($_FILES->getMessage(), 'horde.error');
     } else {
         // display the processed files
         FileUpload::displayUploads($_FILES,'after processing','right');
     }
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FileUpload.php
Type: text/x-csv
Size: 12394 bytes
Desc: not available
Url : http://lists.horde.org/archives/dev/attachments/20030321/e10ff015/FileUpload-0001.bin


More information about the dev mailing list