I am receiving this content length error, however I do have checks in place when user tries to upload an image by checking if it goes over a specified max-image size.
Here is my code:
//file size of the chosen image
$file_size = $_FILES['profile']['size'];
//setting maximum file size
$max_file_size = 50000;
if($file_size < $max_file_size){
change_profile_image($session_user_id, $file_temp, $file_explode);
header('Location: userprofile.php');
exit();
} else {
echo 'File size should be less than 50 KB';
}
So from this check I assume that if a user uploads a file size which is greator than 50 KB it should just echo 'File size should be less than 50 KB'.
Thanks guys p.s Happy Valentines Day and Happy Coding !!!! :)