[英]Uncaught TypeError: $(…).find(…).not(…).size is not a function
I am using uploadify to upload file in laravel with progressbar implementation.我正在使用uploadify在 laravel 中使用进度条实现上传文件。 but when I am uploading file, I am getting this error in console.但是当我上传文件时,我在控制台中收到此错误。
Uncaught TypeError: $(...).find(...).not(...).size is not a function
at HTMLInputElement.<anonymous> (jquery.uploadifive.js:814)
at Function.each (jquery-3.5.1.min.js:2)
at S.fn.init.each (jquery-3.5.1.min.js:2)
at S.fn.init.upload (jquery.uploadifive.js:770)
at S.fn.init.$.fn.uploadifive (jquery.uploadifive.js:872)
at <anonymous>:1:19
I am using laravel and the blade view is我正在使用 laravel 刀片视图是
uploadForm.blade.php上传Form.blade.php
@extends('layouts.artist')
@section('content')
<div id="queue"></div>
<input id="file_upload" name="file_upload" type="file" multiple="true">
<a style="position: relative; top: 8px;" href="javascript:$('#file_upload').uploadifive('upload')">Upload Files</a>
@endsection
@section('script')
<script type="text/javascript">
$(function() {
$('#file_upload').uploadifive({
'auto' : false,
'checkScript' : '',
'fileType' : 'image/png',
'formData' : {
'_token' : "{{csrf_token()}}"
},
'queueID' : 'queue',
'uploadScript' : "{{route('track.upload')}}",
'onUploadComplete' : function(file, data) { console.log(data); }
});
});
</script>
@endsection
and my controller is this我的 controller 是这个
TrackController.php TrackController.php
function upload(Request $request) {
$title = rand(1000000, 9999999);
$request->file_upload->storeAs('public/uploads', $title.'.png');
$response = ['status' => 'ok', 'message' => $title.' successfully uploaded.'];
return response()->json($response);
}
Any help is highly appreciated.非常感谢任何帮助。
The size()
method was deprecated in jQuery 1.8 and removed entirely in 3.0 and higher. size()
方法在 jQuery 1.8 中已弃用,并在 3.0 及更高版本中完全删除。 You should use length
instead.您应该改用length
。
That call appears to be coming from the uploadifive()
library you're using.该调用似乎来自您正在使用的uploadifive()
库。 As such I would assume that library is very outdated.因此,我认为图书馆已经过时了。 I'd suggest finding an alternative.我建议寻找替代方案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.