0
我正在使用uploadify.js進行圖片上傳功能。如何在uploadify.js中顯示無效的文件類型消息?
但是,當我選擇無效的文件類型時,它顯示一個空白的警報消息。
我應該在哪裏編輯文件以將消息顯示爲不支持的文件類型?
我在uploadify.js文件中有以下類型的代碼。
// Run the default event handler
if ($.inArray('onSelectError', settings.overrideEvents) < 0) {
switch(errorCode) {
case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:
if (settings.queueSizeLimit > errorMsg) {
this.queueData.errorMsg += '\nThe number of files selected exceeds the remaining upload limit (' + errorMsg + ').';
} else {
this.queueData.errorMsg += '\nThe number of files selected exceeds the queue size limit (' + settings.queueSizeLimit + ').';
}
break;
case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
this.queueData.errorMsg += '\nThe file "' + file.name + '" exceeds the size limit (' + settings.fileSizeLimit + ').\nPlease upload the file in specified size limit.';
break;
case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
this.queueData.errorMsg += '\nThe file "' + file.name + '" is empty.';
break;
case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
this.queueData.errorMsg += '\nThe file "' + file.name + '" is not an accepted file type (' + settings.fileTypeDesc + ').';
break;
}
我注意到這個SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
被使用了兩次。
我想我需要將FILE_EXCEEDS_SIZE_LIMIT
更改爲無效文件類型的其他內容。 但不知道該寫什麼?