BlueImp在文件上传时无声地失败

时间:2015-07-14 15:20:33

标签: jquery file-upload blueimp

当我尝试使用blueImp上传时,打开控制台时出现了fllowing错误:

Uncaught TypeError: Cannot read property 'parseMetaData' of undefined

伴随着堆栈跟踪。看来我在没有文件的情况下调用上传逻辑。有没有办法可以获得更多信息?

1 个答案:

答案 0 :(得分:13)

确保在任何文件上载脚本之前包含JS脚本https://blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.jsparseMetaData函数需要此文件。

<script>包含应按以下顺序排列,该顺序直接取自https://blueimp.github.io/jQuery-File-Upload/中的示例。

<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="//blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="//blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="js/jquery.fileupload.js"></script>
<!-- The File Upload processing plugin -->
<script src="js/jquery.fileupload-process.js"></script>
<!-- The File Upload image preview & resize plugin -->
<script src="js/jquery.fileupload-image.js"></script>
<!-- The File Upload audio preview plugin -->
<script src="js/jquery.fileupload-audio.js"></script>
<!-- The File Upload video preview plugin -->
<script src="js/jquery.fileupload-video.js"></script>
<!-- The File Upload validation plugin -->
<script src="js/jquery.fileupload-validate.js"></script>
<!-- The File Upload user interface plugin -->
<script src="js/jquery.fileupload-ui.js"></script>