Reputation: 784
I have a minimal setup for jquery file upload. My purpose is to be able to upload large files up to 10GB. But for now i can upload only 25MB max. When upload is done the code returns name of the file. When i try to upload 6GB on my localhost the progressbar hits 100% but returns a strange number like that "1411637366-99" instead of the filename and there is no file in the upload folder. I did not figured it out.
Also i tried to upload a file with 55MB. When i do that, everything looks normal, returns filename correctly but there is no file in the upload folder again.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>jQuery File Upload Example</title>
</head>
<body>
<input id="fileupload" type="file" name="files[]" data-url="server/php/" multiple>
<div id="progress">
<div class="bar" style="width: 0%; height: 18px; background: green;"></div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="js/vendor/jquery.ui.widget.js"></script>
<script src="js/jquery.iframe-transport.js"></script>
<script src="js/jquery.fileupload.js"></script>
<script>
$(function () {
$('#fileupload').fileupload({
dataType: 'json',
done: function (e, data) {
$.each(data.result.files, function (index, file) {
$('<p/>').text(file.name).appendTo(document.body);
});
},
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
$('#progress .bar').css(
'width',
progress + '%'
);
}
});
});
</script>
</body>
</html>
Upvotes: 0
Views: 3345
Reputation: 2216
I think your problem is in the PHP and not in the jquery.
in the php ini file you got:
; Maximum allowed size for uploaded files.
upload_max_filesize = 40M
; Must be greater than or equal to upload_max_filesize
post_max_size = 40M
you should change it to what you wish.
or, if you dont have access to your ini file you can do this on single file [in your case on UploadHandler.pho] with
<?php
ini_set('upload_max_filesize', '10M');
?>
Or as you wrote: you can create an .htaccess file with the following:
php_value upload_max_filesize 10000M and php_value post_max_size 10000M **and** php_value memory_limit 128M
Upvotes: 1