OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
reels
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/17/2025 10:17:24 AM
rwxrwxr-x
📁
assets
-
01/20/2025 08:39:05 AM
rwxr-xr-x
📄
comment.php
441 bytes
05/19/2025 10:07:13 AM
rw-r--r--
📄
db.php
261 bytes
05/19/2025 10:07:13 AM
rw-r--r--
📄
fetch_videos.php
639 bytes
05/19/2025 10:07:13 AM
rw-r--r--
📄
index.php
2.11 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
like.php
285 bytes
05/19/2025 10:07:13 AM
rw-r--r--
📄
upload.php
1.52 KB
05/19/2025 10:07:13 AM
rwxrwxrwx
📁
uploads
-
01/20/2025 08:39:07 AM
rwxrwxrwx
Editing: upload.php
Close
<?php // upload.php include 'db.php'; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $targetDir = __DIR__ . "/uploads/videos/"; if (!file_exists($targetDir)) { mkdir($targetDir, 0777, true); // Create directories with full permissions } $videoFile = $_FILES['video']['name']; $targetFile = $targetDir . basename($videoFile); $videoFileType = strtolower(pathinfo($targetFile, PATHINFO_EXTENSION)); // Validate video format $allowedTypes = ['mp4', 'mov', 'avi', 'webm']; if (!in_array($videoFileType, $allowedTypes)) { die("Invalid video format. Allowed types: mp4, mov, avi, webm."); } // Move the uploaded file if (move_uploaded_file($_FILES['video']['tmp_name'], $targetFile)) { // Generate thumbnail using FFmpeg $thumbnailDir = "uploads/thumbnails/"; $thumbnailFile = $thumbnailDir . pathinfo($videoFile, PATHINFO_FILENAME) . ".jpg"; exec("ffmpeg -i $targetFile -ss 00:00:01.000 -vframes 1 $thumbnailFile"); // Insert into database $userId = 1; // Hardcoded for now, replace with session user ID. $description = $_POST['description']; $stmt = $conn->prepare("INSERT INTO videos (user_id, video_path, thumbnail_path, description) VALUES (?, ?, ?, ?)"); $stmt->bind_param("isss", $userId, $targetFile, $thumbnailFile, $description); $stmt->execute(); echo "Video uploaded successfully!"; } else { echo "Failed to upload video."; } } ?>