Skip to content

Instantly share code, notes, and snippets.

<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['video'])) {
$title = $_POST['title'];
$description = $_POST['description'];
$video_file = $_FILES['video'];
// Validate video file
$allowed_types = ['video/mp4', 'video/webm', 'video/ogg'];
if (in_array($video_file['type'], $allowed_types)) {
$upload_dir = 'uploads/videos/';