Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, i have a webapp that allows users to upload video to server for sharing, but inorder to minimize storage usage i want to set a limi to video file size upload per user.
But when i added a code snippet for the modification after saving and refreshing the page it goes blank i.e it does not show anything on the UI for uploading.
See the code below


if ($_POST['video_type']=='local')
{

$maxsize = 5242880; // 5MB

// Check file size
if(($_FILES['file']['size'] >= $maxsize) || ($_FILES["file"]["size"] == 0)) {
echo "File too large. File must be less than 5MB.";
}else{
// Upload
$file_path = 'http://'.$_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']).'/uploads/';
echo "Upload successfully.";
}
}

/* $file_path = 'http://'.$_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']).'/uploads/'; */

$video_url=$file_path.$_POST['video_file_name'];

$file_name= str_replace(" ","-",$_FILES['video_thumbnail']['name']);

$video_thumbnail=rand(0,99999)."_".$file_name;

//Main Image
$tpath1='images/'.$video_thumbnail;
$pic1=compress_image($_FILES["video_thumbnail"]["tmp_name"], $tpath1, 80);

//Thumb Image
$thumbpath='images/thumbs/'.$video_thumbnail;
$thumb_pic1=create_thumb_image($tpath1,$thumbpath,'200','200');

$video_id='';
}

Kindly help

What I have tried:

I tried searching on google and asking on developer fussion
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900