$('#form-add-video').on('submit', function(e){
e.preventDefault();
var form_data = new FormData(document.getElementById('form-add-video'));
$.ajax({
'method': 'POST',
'url': window.location.href,
'data': form_data,
'beforeSend': function(){
$('.load').show();
},
success:function(data){
$('.load').hide();
console.log(data);
{{--window.location = "{{ route('admin_more.products.create') }}";--}}
},
error: function (xhr, status, errorThrown) {
//Here the status code can be retrieved like;
xhr.status;
//The message added to Response object in Controller can be retrieved as following.
xhr.responseText;
},
"processData": false,
"contentType": false,
})
})
有这段代码(发送到 Laravel 控制器),php.ini 是可以的,所以当我以大约 10 秒(小尺寸)的形式上传视频时,一切正常,当我上传视频 10 分钟或更长时间时, formdata 发送 null 表单中有几个输入文本,一个图像和一个视频