本文介绍了图像验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

function validatefileupload(Source, args)
{
  var fuData = document.getElementById(''<%= FileUpload1.ClientID %>'');
  var FileUploadPath = fuData.value;
  if(FileUploadPath =='''')
  {
    // There is no file selected
    args.IsValid = false;
  }
  else
  {
    var Extension = FileUploadPath.substring(FileUploadPath.lastIndexOf(''.'') + 1).toLowerCase();
    if (Extension == "jpg" || Extension == "gif" || Extension=="png" || Extension=="jpeg")
    {
      args.IsValid = true; // Valid file type
    }
    else
    {
      args.IsValid = false; // Not valid file type
    }
   }
}



当我选择一个文件时,它无法正常工作.请告诉我这段代码有什么问题.
正确地,当我上传任何图像时,它会显示错误消息!!! ...不会继续..



When I am selecting a file, it is not working correctly. Please tell me what is wrong in this code.
ACtually , when i upload any image it display the error message !!!... not going furthur ..

推荐答案


这篇关于图像验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 22:46