我尝试创建一个上传大文件的脚本,我通过ajax发送数据(它的工作),但这并没有解决大文件的问题,在最好的情况下,我只能上传100 MB,这对用户,你能帮我添加分块文件上传吗,谢谢
这是我的HTML:
<form id="upload_form" method="POST" enctype="multipart/form-data">
@csrf
<input type="file" name="file" id="file-7" class="inputfile inputfile-6" />
<center>
<a href="#" id="star_up" value="hide/show">
<input class="btn btn-info btn-lg wow tada" id="sell_house_submit" type="submit" name="upload_file" value="@lang('lang.UPLOAD')">
</a>
</center>
<div id="prog" style="display:none;">
<progress id="progressBar" class="wow tada" style="@if(isMobile())width:200px;@else width:750px;@endif height: 10px;" value="0" max="100">
</progress>
<h3 class="av" id="status" ></h3>
<p id="loaded_n_total" ></p>
Run Code Online (Sandbox Code Playgroud)
我的javascript:
$(document).ready(function(){
$('#upload_form').on('submit', function(event){
$.ajax({
url:"{{ route('upload') }}",
method:"POST",
data: new FormData(this),
xhr: function() {
var myXhr = $.ajaxSettings.xhr();
if(myXhr.upload){
myXhr.upload.addEventListener('progress',progressHandler, …Run Code Online (Sandbox Code Playgroud)