//add duplicate file if exist and rename
        $result = $upload->getMessages();
    } catch (Exception $e) {
        echo $e->getMessage();
    }
} elseif (isset($_POST['uploadV'])) {
    if (isset($_POST['folderV'])) {
        $folder = $_POST['folderV'];
    } else {
        $folder = 'other';
    }
    $dest = './uploads/videos/' . $folder . '/';
    // destination of uploaded files
    require_once './upload_class.php';
    try {
        $upload = new c1_Upload($dest);
        //change max size of file allowed through $max var on top
        $upload->setMaxSize($max);
        //AVI videos
        $upload->setPermittedTypes(array('video/avi', 'video/msvideo', 'video/x-msvideo', 'image/avi', 'video/xmpg2', 'application/x-troff-msvideo', 'audio/aiff', 'audio/avi'));
        $upload->move();
        //add duplicate file if exist and rename
        $result = $upload->getMessages();
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}
?>

<!DOCTYPE html>
<html lang="en-US" style="height: 100%">
Пример #2
0
    }
    //$stmt->prepare($sql);		//prepare SQL
    //bind paramaters to query
    //$stmt->bind_param('ssi', $_POST['location'], $_POST['date'], $_POST['reserve_ID']);
    //$done = $stmt->execute();   //execute query
    //}
}
//multiple uploads are allowed, no limit is imposed on total size of all selected uploaded files
//the limit above applies to each individual file
// you can customize error messages and other options at the class file (Upload_class.php) , please also see that code
if (isset($_POST['uploadA'])) {
    $dest = './admin/uploads/attach/';
    // destination of uploaded files
    require_once './admin/upload_class.php';
    try {
        $upload = new c1_Upload($dest);
        //change max size of file allowed through $max var on top
        $upload->setMaxSize($max);
        $upload->setPermittedTypes(array('image/gif', 'image/jpeg', 'image/jpg', 'image/pjpeg', 'image/png', 'image/tiff', 'application/pdf', 'application/x-pdf', 'text/plain', 'text/rtf', 'application/msword', 'application/vnd.ms-powerpoint', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'application/vnd.openxmlformats-officedocument.presentationml.template', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.openxmlformats-officedocument.presentationml.slide', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'application/vnd.ms-excel.addin.macroEnabled.12', 'application/vnd.ms-excel.sheet.binary.macroEnabled.12'));
        $upload->move();
        //add duplicate file if exist and rename
        $result = $upload->getMessages();
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}
// redirect page on success or if $_GET['reserve_ID'] not defined
if ($done || !isset($_GET['reserve_ID'])) {
    //header('Location: ' . './memberpage.php'); 	//redirect to list of reservations
    // "message.php?reserve_ID=<?php echo $row['reserve_ID'];
    header('Location: ' . "./message.php?reserve_ID={$reserve_ID}");
Пример #3
0
$max = 2097152;
// 2,097,152 is 2 MB	limit in 000webhost
//multiple uploads are allowed, no limit is imposed on total size of all selected uploaded files
//the limit above applies to each individual file
// you can customize error messages and other options at the class file (Upload_class.php) , please also see that code
if (isset($_POST['uploadP'])) {
    if (isset($_POST['folderI'])) {
        $folder = $_POST['folderI'];
    } else {
        $folder = 'other';
    }
    $dest = './uploads/photos/' . $folder . '/';
    // destination of uploaded files
    require_once './upload_class.php';
    try {
        $upload = new c1_Upload($dest);
        //change max size of file allowed through $max var on top
        $upload->setMaxSize($max);
        $upload->setPermittedTypes(array('image/gif', 'image/jpeg', 'image/jpg', 'image/pjpeg', 'image/png'));
        $upload->move();
        //add duplicate file if exist and rename
        $result = $upload->getMessages();
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}
?>

<!DOCTYPE html>
<html lang="en-US" style="height: 100%">
<head>