我正在使用来自这里https://github.com/blueimp/jQuery-File-Upload的文件上传插件“blueimg 文件上传” 。
它暗示了一些错误,如下所示:
window.locale = {
"fileupload": {
"errors": {
"maxFileSize": "File is too big",
"minFileSize": "File is too small",
"acceptFileTypes": "Filetype not allowed",
"maxNumberOfFiles": "Max number of files exceeded",
"uploadedBytes": "Uploaded bytes exceed file size",
"emptyResult": "Empty file upload result"
},
"error": "Error",
"start": "Start",
"cancel": "Cancel",
"destroy": "Delete"
}
};
但是,我怎么能抛出这些错误。例如:我可以检查服务器端的最大文件大小,然后将相应的错误代码响应到客户端的 blueimg 插件。
而且,我想给它注入更多的错误映射。如何完成?
提前致谢。