Hi,
I create a simple code to upload file using php code.
index.php
<?php
@ini_set('upload_max_filesize', '1024000000000M');
@ini_set('post_max_size', '1024000000000M');
@ini_set('max_input_time', 3600000000000);
@ini_set('max_execution_time', 3600000000000);
?>
<!doctype html>
<head>
<title>Proalbum: File Upload </title>
<style>
body { padding: 30px }
form { display: block; margin: 20px auto; background: #87bb2f; border-radius: 10px; padding: 15px }
.progress { position:relative; width:400px; border: 1px solid #ddd; padding: 1px; border-radius: 3px; background:#FF0000;}
.bar { background-color:#87bb2f; width:0%; height:20px; border-radius: 3px; }
.percent { position:absolute; display:inline-block; top:3px; left:48%; }
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<h1>Select a File to Upload</h1>
<form action="video_upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="uploadedfile"><br>
<input type="submit" value="Upload File">
<input type="hidden" name="MAX_FILE_SIZE" value="99999999"/>
</form>
<div class="progress">
<div class="bar"></div >
<div class="percent">0%</div >
</div>
<div id="status"></div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
<script src="http://malsup.github.com/jquery.form.js"></script>
<script>
(function() {
var bar = $('.bar');
var percent = $('.percent');
var status = $('#status');
$('form').ajaxForm({
beforeSend: function() {
status.empty();
var percentVal = '0%';
bar.width(percentVal)
percent.html(percentVal);
},
uploadProgress: function(event, position, total, percentComplete) {
var percentVal = percentComplete + '%';
bar.width(percentVal)
percent.html(percentVal);
},
complete: function(xhr) {
bar.width("100%");
percent.html("100%");
status.html(xhr.responseText);
}
});
})();
</script>
</body>
</html>
video_upload.php
<?php
@ini_set('upload_max_filesize', '1024000000000M');
@ini_set('post_max_size', '1024000000000M');
@ini_set('max_input_time', 3600000000000);
@ini_set('max_execution_time', 3600000000000);
//$upload_dir = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']);
$upload_dir='rajesh';
$upload_url = '/';
$temp_name = $_FILES['uploadedfile']['tmp_name'];
$file_name = $_FILES['uploadedfile']['name'];
$file_path = $upload_dir.$upload_url.$file_name;
if(move_uploaded_file($temp_name, $file_path))
{
echo "File uploaded Success !";
}
?>
and
php.ini
max_execution_time: 3600000000000
max_input_time 3600000000000
post_max_size 1024000000000M
upload_max_filesize 1024000000000M
and in .htaccess file
php_value max_execution_time 3600000
php_value max_input_time 3600000
php_value post_max_size 1024000M
php_value upload_max_filesize 1024000M
But still can’t able to upload file more than 20 mb.
Can anyone please help me in this.
Thanks