here my function:
if (!empty($_FILES['file2'])) {
$files = true;
// Handle the file uploads
$files2 = $_FILES['file2'];
$maxFileSize = 500 * 1024 * 1024; // 500 MB in bytes
foreach ($files2['name'] as $key2 => $value2) {
if ($files2['error'][$key2] == UPLOAD_ERR_OK) {
if ($files2['size'][$key2] <= $maxFileSize) {
$job_file = $files2['name'][$key2];
$inputFile = $files2['tmp_name'][$key2];
$file_name = pathinfo($job_file, PATHINFO_FILENAME);
$compress_file = $file_name . '.mp4';
$fileTempath = '../assets/files/temp';
$outputFile = '../assets/files/' . $compress_file;
$ffmpeg_path = '../assets/vendor/libs/ffmpeg/bin/ffmpeg';
$command = sprintf(
'%s -i %s -vf scale=640:360 -crf 28 -preset fast %s',
escapeshellarg($ffmpeg_path),
escapeshellarg($inputFile),
escapeshellarg($outputFile)
);
$output = shell_exec($command);
move_uploaded_file($outputFile, $fileTempath);
$job_file_column2[] = $compress_file;
} else {
$upload_errors = true;
$errors[] = 'Error: Video size exceeds 500 MB ' . ($key2 + 1) . ': ' . $files2['name'][$key2];
}
} else {
$upload_errors = true;
$errors[] = 'Error uploading file ' . ($key2 + 1) . ': ' . $files2['name'][$key2];
}
}
}
} catch (Exception $e) {
$errors[] = $e->getMessage();
}
file resized and uploaded on localhost but on live server its not uploading file in folder i also try other folder but its not working