You may upload videos to our site below:
You may upload up to 4 videos at a time. Files should be under 250MB each.
Allowed file extensions: mpg, mpeg, avi, wmv, mp4, m4v and mov
You may upload up to 4 videos at a time. Files should be under 250MB each.
Allowed file extensions: mpg, mpeg, avi, wmv, mp4, m4v and mov
Please try again...';
$duplicate_alert = $config_values['duplicate_alert'] ? $config_values['duplicate_alert'] : 'This file has already been selected';
$size_alert = $config_values['size_alert'] ? $config_values['size_alert'] : 'Upload failed! The file exceeded the maximum allowed size.';
$mkdir_alert = $config_values['mkdir_alert'] ? $config_values['mkdir_alert'] : 'Could not create temporary directory on server!';
$passphrase_alert = $config_values['passphrase_alert'] ? $config_values['passphrase_alert'] : 'Passphrase is not correct! Please try again...';
$failure_alert = $config_values['failure_alert'] ? $config_values['failure_alert'] : 'File was not successfully uploaded from your computer.';
$name_alert = $config_values['name_alert'] ? $config_values['name_alert'] : 'File name not supplied by the browser.';
$rename_alert = $config_values['rename_alert'] ? $config_values['rename_alert'] : 'Could not rename uploaded file!';
$success_alert = $config_values['success_alert'] ? $config_values['success_alert'] : 'All files were successfully uploaded!';
$login_alert = $config_values['login_alert'] ? $config_values['login_alert'] : 'Unable to connect to service.';
echo '';
echo '';
if ($_POST) {
try {
$typed_pass = $_POST['passphrase'];
$passphrase = '';
if ($passphrase && $typed_pass !== $passphrase) {
throw new Exception($passphrase_alert);
}
$tmpDir = uniqid('files/upload-');
if (!mkdir($tmpDir)) {
throw new Exception($mkdir_alert);
}
foreach ($_FILES["file_stacks_in_3_page6"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_FORM_SIZE) {
throw new Exception($size_alert);
}
if ($error !== UPLOAD_ERR_OK) {
throw new Exception($failure_alert);
}
if ($_FILES['file']['name'] === "") {
throw new Exception($name_alert);
}
$tmp_name = $_FILES["file_stacks_in_3_page6"]["tmp_name"][$key];
$name = $_FILES["file_stacks_in_3_page6"]["name"][$key];
$new_name = $tmpDir.'/'.str_replace("/\0", '_', $name);
if (!is_uploaded_file($tmp_name) or !copy($tmp_name, $new_name)) {
throw new Exception($rename_alert);
}
// Upload to SFTP
set_include_path(get_include_path() . PATH_SEPARATOR . 'files/PHP_SEC_LIB');
require_once('Net/SFTP.php');
$sftp = new Net_SFTP('gayv.net', 22);
if (!$sftp->login('gayv', 'TNT]-t597#HB?Mu{pu')) {
throw new Exception($login_alert.' (SFTP)');
}
$dir = trim('/home/gayv/upload');
$destination = $dir ? $dir.'/'.$name : $name;
//$data = $sftp->get($new_name,true);
$sftp->put($destination, $new_name, NET_SFTP_LOCAL_FILE);
// Clean up
if (isset($new_name) && file_exists($new_name)) {
unlink($new_name);
}
echo '';
}
}
catch(Exception $e) {
if (isset($new_name) && file_exists($new_name)) {
unlink($new_name);
}
echo '';
}
if (isset($tmpDir) && file_exists($tmpDir)) {
rmdir($tmpDir);
}
}
?>