我想用jQuery上传mp3文件。在正常的轨道上一切工作正常。但是如果我想上传一些混合文件,这些文件都是大于100MB的大文件,那么上传就会失败。
这是我的上传函数:
$(document).ready(function() {
$('#upFile').on('change', function() {
$('#btnSubmit').fadeIn();
});
$('#uploadForm').submit(function(e) {
if($('#upFile').val()) {
e.preventDefault();
$('#btnSubmit').fadeOut();
$('#progress-div').fadeIn();
$(this).ajaxSubmit({
beforeSubmit: function() {
$("#progress-bar").width('0%');
},
uploadProgress: function (event, position, total, percentComplete) {
$("#progress-bar").width(percentComplete + '%');
$("#progress-bar").html('<div id="progress-status">' + percentComplete +' %</div>')
},
success: function(responseText, statusText, xhr, $form) {
$('#progress-div').fadeOut(function() {
//$("#progress-bar").width('0%');
//$("#progress-bar").html('<div id="progress-status">0 %</div>');
var obj = JSON.parse(responseText);
if(obj.success == '1') {
window.location.replace("./player");
} else {
alert(obj.error);
}
});
},
resetForm: true
});
return false;
}
});
}); 是什么导致了这种行为?
发布于 2017-09-14 05:59:42
确保有足够的存储空间用于上传后,检查php.ini文件中的upload_max_filesize。在命令行中,键入php -i | grep upload_max_filesize或创建仅包含以下内容的secret.php文件
<php phpinfo();或
<php echo ini_get('upload_max_filesize');并查找upload_max_filesize
发布于 2019-04-13 20:05:31
编辑php.ini文件并设置:
memory_limit = 256M
upload_max_filesize = 120M
post_max_size = 150M然后重新启动apache。
https://stackoverflow.com/questions/46207359
复制相似问题