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

📄 sharepic.asp

📁 功能非常强大的一款办公自动化软件原代码,其中的文档签收功能特别实用.不相信下下来看下.
💻 ASP
字号:
<!--#include file="check.asp"-->
<!--#INCLUDE FILE="connect.asp" --> 
<%
  LocalFile="sharepic.asp"
  Fj="savepic.asp"
  HttpUrl="http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME") 
  HttpUrl=Left(HttpUrl,Len(HttpUrl)-Len(LocalFile))
  NameUrl=HttpUrl & NameFile
  FjUrl=HttpUrl & Fj
  writetime=CDate(now())
  ipaddress=request.servervariables("remote_addr")
  set rs=server.createobject("adodb.recordset")
  if  Request.ServerVariables("Request_Method")="POST" then
    set bzwb=server.createobject("oaserver.sharepic")
     bzwb.main(conn)
  'conn.close
  'set conn=nothing
  response.write("<script language=javascript>alert('添加成功!');opener.location=opener.location;window.close()</script>")
 response.end
  end if
  
  sql="delete from sharepic where shareid="&session.SessionID
  
  'sql="select * from sharepic"
  'rs.open sql,conn,1,1
   'rs.close
  conn.execute(sql)
%>
<html>
<head>
<title>共享资源</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="outplan.css" type="text/css">
<style type="text/css">
<!--
.style2 {font-size: 10pt}
-->
</style>
</head>
<script language="JavaScript" src="swfj.js"></script>
<script language=javascript>
function test(){

    if(document.form.title.value==""){
	alert("还没有填写标题");
	return false;
	}
	
	var form = document.form;
	for ( var i= 0 ; i <form.elements.length ; i ++ ) {				    
		if ( form.elements[i].type == "file" && form.elements[i].name !="file" ) {
			if (form.elements[i].value!="") {
				sendfj(i);
			}
		}
	}//for

    document.form.submit();
   
}

function sendfj(fileid){

	var FjUrl="<%=FjUrl%>"                  //保存附件文件url路径
	var MaxSize="5000000"                 //限制上传附件文件的大小为5M 
	var form = document.form;
	PsoPath=form.elements[fileid].value
	//PsoPath=document.form.filefj0.value
	PsoFile=PsoPath                     //定义附件的文件名
	PsoType=""
    while(PsoFile.indexOf("\\")>0)             //获得附件的文件名
    { 
     i = PsoFile.indexOf("\\") 
     PsoFile = PsoFile.substring(i + 1, PsoFile.length); 
    }                                //获得附件的文件名
	                    
	 PsoPath=PsoPath.substring(0,PsoPath.lastIndexOf("\\"))   //获得附件的路径
	 PsoType=PsoFile
	 if (PsoType.lastIndexOf(".")>0)              //获得附件的扩展名
     { 
     i = PsoType.lastIndexOf(".") 
     PsoType = PsoType.substring(i + 1, PsoType.length); 
     } 
    
	PsoType=PsoType.toLowerCase();
	if (PsoType!="jpg"&&PsoType!="bmp"&&PsoType!="gif") {
	alert("上传的文件不是图片格式!");
	window.close();
	return false;
	}
   result=form.web.upload(FjUrl,PsoFile,PsoPath,MaxSize)  //向服务器上传附件
   //document.form.fujian.value=PsoFile
  if (!result)
  {
   alert("上传附件失败或附件不存在!");
   window.close();
   return false;                             //上传附件失败,返回起草公文页面
   }
   else{
   //alert("上传附件成功!");
   //document.form.submit();
   
   //result=form.web.sendurltry(NameUrl,PsoFile,PsoType)
   }
     
}


</script>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="form" method="POST" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="35">
    <tr> 
      <td background="images/outplan4.gif" valign="top"> 
        <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
          <tbody> 
          <tr> 
            <td width="30" align="right"><img src="images/outplan10.gif" width="22" height="35"></td>
            <td width="70" align="center"> <a href="#" class="wlink" onClick="return test();return false;">添 
              加</a></td>
             <td width="3"><img src="images/outplanline.gif" width="16" height="35"></td>
            <td width="22"><img src="images/outplan5.gif" width="22" height="35"></td>
            <td width="70" align="center"> <a href="#" onClick="window.close()" class="wlink">关 
              闭</a></td>
            <td width="6"><img src="images/outplanline.gif" width="16" height="35"></td>
            <td class="wnolink">&nbsp;</td>
          </tr>
          </tbody> 
        </table>
      </td>
    </tr>
  </table>
  <table width="100%" border="0" cellspacing="0" cellpadding="0" height="40">
    <tbody> 
    <tr> 
      <td width="326" background="images/outplan1.gif" class="outtitle">&nbsp;&nbsp;<span class="style2">添加资源</span></td>
      <td width="91"><img src="images/outplan11.gif" width="91" height="40"></td>
      <td width="337" valign="top" background="images/outplan3.gif"> </td>         </td>
      </tr>
    </tbody> 
  </table>
  <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" height="123">
    <tr> 
      <td height="33" valign="top"> 
        <div align="center"> 
          <table width="100%" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF" align="center">
            <tr>
              <td height="27" align="left">&nbsp;</td>
              <td align="left">&nbsp;</td>
              <td height="27">&nbsp;</td>
            </tr>
			  <tr>
              <td width="50" height="40" align="left">&nbsp; </td>
              <td width="209" align="left">属 性: </td>
              <td width="493" height="40"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
                  <tr>
                    <td>
					<input name="isshare" type="radio" value="0" checked>
                    不共享
                   <input type="radio" name="isshare" value="1">共享 </td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td width="50" height="40" align="left">&nbsp; </td>
              <td width="209" align="left">标 题: </td>
              <td width="493" height="40"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
                  <tr>
                    <td><input name="title" type="text" class="noinput" size="40" maxlength="40">
                    </td>
                  </tr>
              </table></td>
            </tr>
			            <tr>
              <td width="50" height="40" align="left">&nbsp; </td>
              <td width="209" align="left">附 件: </td>
              <td width="493" height="40"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
                  <tr>
                    <td>
					<span id="idfilespan"></span>
                    <a href="javascript:;" name="attach" id="attach" onclick="add();this.childNodes[0].nodeValue='继续添加照片';" title="如果您要发送多个照片">添加照片</a>
					</td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td height="32" align="left"></td>
              <td height="32" align="left"></td>
              <td height="32" align="left"><table width="90%" border="0" cellspacing="0" cellpadding="0">
                <tr height="1">
                  <td bgcolor="0066CC" height="1"></td>
                </tr height="1">
                <tr>
                  <td bgcolor="ffffff" height="1"></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td height="40" align="left">&nbsp;</td>
              <td align="left">内 容:</td>
              <td height="40"><textarea name="content" cols="69" rows="5" class="body1" style="width:300px;"></textarea>
             </td>
            </tr>
          </table>
	    </div>
      </td>
    </tr>
  </table>

  
<object width="1" height="1" classid="clsid:8C9AA244-AC33-47F9-8968-CC114654A6EC" codebase="web.ocx" id="web">
  </object>
		

</form>
</body>
</html>

⌨️ 快捷键说明

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