Forum Moderators: coopster
The problem could be an error in the script or it could be something making your browser or server time-out, it may be file permissions or other issues. We need a little bit more info about the script and problem.
If your code is short why dont you post it so we know what you are doing.
Also if you are getting an error then copy that error and post that as well.
need help?
<?php
@ini_set("max_execution_time","5000");
define(VIDEO_FILE_PATH,$arrConfig['sourceRoot'].'common/uploaded_files/');// define path here
define(MAX_IMAGE_SIZE,'104857600');// 100 mb
$_SESSION['varUploadMsg']='';
define(VIDEO_FILE_PATH,$arrConfig['sourceRoot'].'common/uploaded_files/');// define path here
define(MAX_IMAGE_SIZE,'104857600');// 100 mb
//$varVideoFileSize=round($_FILES[frmVideoFile]['size'] /(1024 * 1024),2);
$varMaxImageSize = MAX_IMAGE_SIZE;
//**** files check
$varVideoFileName = $_FILES['frmFileUpload']['name'];
$varVideoFileType = $_FILES['frmFileUpload']['type'];
$varVideoFileSize = $_FILES['frmFileUpload']['size'];
$varVideoUploadFileName = $_FILES['frmFileUpload']['tmp_name'];
//*** other files check
if($varVideoFileSize > 0 && is_uploaded_file($varVideoUploadFileName))
{
if($varVideoFileSize > $varMaxImageSize)
{
$varErrorMsg = 'Image size must be less than 100MB.';
$_SESSION['varUploadMsg'] = $varErrorMsg;
}
//echo strrchr($varVideoFileName,'.');
if($varErrorMsg == '')
{
if (file_exists(VIDEO_FILE_PATH.$varVideoFileName))
{
srand((double)microtime()*1000000); // random number inizializzation
$varVideoFileName = rand(0,20000).$varVideoFileName; // add number to file name
}
//echo $varVideoUploadFileName.":".VIDEO_FILE_PATH.$varVideoFileName."";
if (!@move_uploaded_file ($varVideoUploadFileName,VIDEO_FILE_PATH.$varVideoFileName) )
{
$varErrorMsg = "video file can not copy to".VIDEO_FILE_PATH.".";
$_SESSION['varUploadMsg'] = $varErrorMsg;exit;
}
else
{
$varSuccessMsg ="Video file has been uploaded successfully";
$_SESSION['varUploadMsg'] = $varSuccessMsg;
exit;
}
}
}
?>