首页 >
Image Height Limit:
Image Width Limit:
Image Preview
function CheckFileSize() { var limit = document.getElementById(“fileSizeLimit”).value * 1024; var width = document.getElementById(“widthLimit”).value ; var height = document.getElementById(“heightLimit”).value;
if (oFileChecker.fileSize > limit) { alert(“FileSize :”+oFileChecker.fileSize+”byte–too large!”); } else { alert(“FileSize :”+oFileChecker.fileSize+”byte–ok”); }
if( oFileChecker.height> height) { alert(“ImageHeight :”+oFileChecker.height+”–too height!”); } else { alert(“ImageHeight :”+oFileChecker.height+”–ok”); } if(oFileChecker.width> width) { alert(“ImageWidth :”+oFileChecker.width+”–too width!”); } else { alert(“ImageWidth :”+oFileChecker.width+”–ok”); } return false; }
var right_type=new Array(“.jpg”,”.jpg”,”.jpeg”,”.jpg”,”.jpg”);
var oFileChecker = document.getElementById(“fileChecker”);
function changeSrc(filePicker) { if(!checkImgType(filePicker.value)) { alert(“the file type is not correct”); return; } oFileChecker.src = filePicker.value; }
oFileChecker.onreadystatechange = function () { if (oFileChecker.readyState == “complete”) { CheckFileSize(); } }
function checkImgType(fileURL) { var right_typeLen=right_type.length; var imgUrl=fileURL.toLowerCase(); var postfixLen=imgUrl.length; var len4=imgUrl.substring(postfixLen-4,postfixLen); var len5=imgUrl.substring(postfixLen-5,postfixLen); for (i=0;i<right_typeLen;i++) { if((len4==right_type[i])||(len5==right_type[i])) { return true; } } }
Symfony2使用第三方库Upload制作图片上传实例详解【PHP】 | Symfony2使用第三方库Upload制作图片上传实例详解【PHP】 ...
html5 canvas移动浏览器上实现图片压缩上传技巧 | html5 canvas移动浏览器上实现图片压缩上传技巧 ...
php基于CodeIgniter实现图片上传、剪切功能, | php基于CodeIgniter实现图片上传、剪切功能, ...