note 36885 added to features.file-upload

From: Date: Sun, 26 Oct 2003 08:55:09 +0000
Subject: note 36885 added to features.file-upload
Groups: php.notes 
Request: Send a blank email to php-notes+get-59299@lists.php.net to get a copy of this message
a cool function for uploading arbitrary number of files: function upload_files($path,$overwrite=NULL,$names=NULL){ global $_FILES; foreach($_FILES as $key => $FILE){ if( empty($FILE['name']) || ( empty($overwrite) && file_exists($path."/".basename($FILE['name'])) ) )continue; if( !copy($FILE['tmp_name'], $path."/". (empty($names[$key])?basename($FILE['name']):basename($names[$key])) )) echo "<br>Fail to copy ".$FILE['tmp_name'] ; } } ---- Manual Page -- http://www.php.net/manual/en/features.file-upload.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+36885 Delete -- http://master.php.net/manage/user-notes.php?action=delete+36885&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+36885&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#59299) next »