⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uppic.asp

📁 这是一个物流网站的源代码
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<style type="text/css">
<!--
.tx1 { height: 20px; width: 30px; font-size: 9pt; border: 1px solid; border-color: black black #000000; color: #0000FF}
.bt {  font-size: 9pt; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; height: 16px; width: 30px; background-color:#ffffff; cursor: hand}
.bt1 {  font-size: 9pt; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; height: 16px; width: 60px; background-color:#ffffff; cursor: hand}
-->
</style>
<body bgcolor="#f0f0f0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="341" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr> 
    <td width="438" height="29"><form action="upsavepic.asp" method="post" enctype="multipart/form-data" name="form1">
        <input name="file" type="file" size=1 style="width:200" class="tx1"  onChange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG,RAR,ZIP,EXE,DOC,XLS,CHM,HLP,PDF,SWF',true,'5120','','','','','','')">
        <input type="submit" name="Submit" value="上传"  class="bt" onclick="parent.document.form1.Submit.disabled=true">
        
		<input name="button1" type="button" id="button1" value="重新上传" class="bt1" onClick="history.go(0)">
		<input name="tup" type="hidden" id="tup" value="<%=request("tup")%>">
		<input name="tup2" type="hidden" id="tup2" value="<%=request("tup2")%>">
		<input name="filepath" type="hidden" id="filepath" value="<%=request("up")%>">
		
      </form></td>
  </tr>
</table>
</body>
</html>
<script language="JavaScript">
<!--

function checkFileUpload(form,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
  document.MM_returnValue = true;
  for (var i = 0; i<form.elements.length; i++) {
    field = form.elements[i];
    if (field.type.toUpperCase() != 'FILE') continue;
    checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
} }

function checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
  document.MM_returnValue = true;
  if (extensions != '') var re = new RegExp("\.(" + extensions.replace(/,/gi,"|").replace(/\s/gi,"") + ")$","i");
    if (field.value == '') {
      if (requireUpload) {alert('File is required!');document.MM_returnValue = false;field.focus();return false;}
    } else {
      if(extensions != '' && !re.test(field.value)) {
        alert('不允许上传此种文件类型.\n 只能上传现列出的文件类型: ' + extensions + '.\n 请重新选择文件类型.');
        document.MM_returnValue = false;field.focus();document.form1.Submit.disabled=true;return false;
      }
    document.PU_uploadForm = field.form;
    re = new RegExp(".(gif|jpg|png|bmp|jpeg|rar|zip|exe|doc|xls|chm|hlp|pdf|swf)$","i");
    if(re.test(field.value) && (sizeLimit != '' || minWidth != '' || minHeight != '' || maxWidth != '' || maxHeight != '' || saveWidth != '' || saveHeight != '')) {
      checkImageDimensions(field,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
    } }
}

function showImageDimensions(fieldImg) { //v2.09
  var isNS6 = (!document.all && document.getElementById ? true : false);
  var img = (fieldImg && !isNS6 ? fieldImg : this);
  if (img.width > 0 && img.height > 0) {
  if ((img.minWidth != '' && img.minWidth > img.width) || (img.minHeight != '' && img.minHeight > img.height)) {
    alert('你上传的图片太小!\n必须为 ' + img.minWidth + ' x ' + img.minHeight);document.form1.Submit.disabled=true; return false;}
  if ((img.maxWidth != '' && img.width > img.maxWidth) || (img.maxHeight != '' && img.height > img.maxHeight)) {
    alert('你上传的图片太大!\n 必须最大为 max ' + img.maxWidth + ' x ' + img.maxHeight);document.form1.Submit.disabled=true; return false;}
  if (img.sizeLimit != '' && img.fileSize > img.sizeLimit) {
    alert('你上传的文件太大!\n不能超过 ' + (img.sizeLimit/1024) + ' KBytes');document.form1.Submit.disabled=true; return false;}
  if (img.saveWidth != '') document.PU_uploadForm[img.saveWidth].value = img.width;
  if (img.saveHeight != '') document.PU_uploadForm[img.saveHeight].value = img.height;
  document.MM_returnValue = true;
} }

function checkImageDimensions(field,sizeL,minW,minH,maxW,maxH,saveW,saveH) { //v2.09
  if (!document.layers) {
    var isNS6 = (!document.all && document.getElementById ? true : false);
    document.MM_returnValue = false; var imgURL = 'file:///' + field.value.replace(/\\/gi,'/').replace(/:/gi,'|').replace(/"/gi,'').replace(/^\//,'');
    if (!field.gp_img || (field.gp_img && field.gp_img.src != imgURL) || isNS6) {field.gp_img = new Image();
		   with (field) {gp_img.sizeLimit = sizeL*1024; gp_img.minWidth = minW; gp_img.minHeight = minH; gp_img.maxWidth = maxW; gp_img.maxHeight = maxH;
  	   gp_img.saveWidth = saveW; gp_img.saveHeight = saveH; gp_img.onload = showImageDimensions; gp_img.src = imgURL; }
	 } else showImageDimensions(field.gp_img);}
}


//-->
</script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -