Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 89346381d9fb64d9ee8827de5f073355 > files > 173

php-pear-HTML_Progress2-2.4.1-3mdv2010.0.noarch.rpm

<?php
/**
 * Basic AFLAX file upload example that used standard PHP functions
 * to handle uploaded files.
 *
 * @version    $Id: upload.php,v 1.1 2007/02/01 10:39:42 farell Exp $
 * @author     Laurent Laville <pear@laurent-laville.org>
 * @package    HTML_Progress2
 * @subpackage Examples
 * @access     public
 * @link       http://www.php.net/manual/en/features.file-upload.php
 *             Handling file uploads
 */

$dest_dir = 'web_files/';

$html_output = 'No file uploaded !';

if (is_uploaded_file($_FILES['Filedata']['tmp_name'])) {
    if (move_uploaded_file($_FILES['Filedata']['tmp_name'], $dest_dir . $_FILES['Filedata']['name'])) {
        $html_output = 'Upload finished';
    } else {
        $html_output = 'Upload failed';
    }
}

echo "<html><head></head><body><script type='text/javascript'>document.write('".
    addslashes($html_output). "');</script></body></html>";
flush();
?>