当前位置: 首页 > 图文教程 > 网络编程 > ASP > 无组件上传图片至SQLSERVER数据库

ASP
开辟一条自由ASP快车道
用XML结合数据库,给服务器减负。
纯编码实现数据库的建立或压缩
多个表单和多个图片一起上传完美解决方案
列表项可上下移动的Multiple列表
模拟QQ的下拉列表选择图象
利用FSO取得BMP,JPG,PNG,GIF文件信息(大小,宽、高等)
二级域名原理以及程序,申请即可开通.
利用ASP+XML架设在线考试系统
ASP项目中的通用条件查询模块
一个为字符串中的网址加上链接的程序例子
用Agent+ASP技术制作语音聊天室
多表单域无组件文件上传的例子
使用xmlhttp为网站增加股市行情查询功能
用ASP开发WEB日期选择器
javascript+HTML仿造VB里的MonthView控件
使用xmlHttp结合ASP,实现网页的异步调用
调用DirectX的组件实现的时钟
在ASP页里面注册DLL的VBScript CLASS
ASP程序界面的多语言支持

ASP 中的 无组件上传图片至SQLSERVER数据库


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 33 ::
收藏到网摘: n/a

 

在无组件上传我刚试成功,所以提供代码给大家一起共享。

/*  addemployee.asp   */
<html>
<head>
<title>职工之家</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/site_css.css" type="text/css">
</head>

<script language="javascript">
<!--
 //选择分类
 ///////////////////////////////////////////////////////////////////////
 function selectsort(txtSubject){
   var returnValue
   returnValue=window.showModalDialog("selMode.htm",null,"center:1;status:0;help:0;resized:0;dialogheight:300px;dialogwidth:206px");
   if (returnValue!="" && returnValue!=null){
      txtSubject.value=returnValue
   }
 }
 ///////////////////////////////////////////////////////////////////////
 //合法性检查
 function isOK(thisForm){
   var strTemp,strValue,strLen,strExName
  if(thisForm.txtTitle.value==""){
      alert("提示:标题不能为空,请正确输入")
   thisForm.txtTitle.focus()
   return false
   }
   if(thisForm.txtSort.value==""){
      alert("提示:请正确选择分类")
   thisForm.txtSort.focus()
   return false
   }
   /*检查图片类型*/
   if(thisForm.file.value!=""){
      strTemp=thisForm.file.value
   strValue=strTemp.toLowerCase()
   strLen=strTemp.length
   strExName=strValue.substring(strLen-4,strLen)
   if (strExName!=".jpg" && strExName!=".gif"){
       alert("请选择jpg或者gif文件!")
    return false
   }
   return true
   }
 }
//-->
</script>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="1" topmargin="1">
<form name="form1" method="post" action="transact1.asp" enctype="multipart/form-data">
  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="2" bgcolor="#006699" height="15">&nbsp;</td>
    </tr>
    <tr>
      <td class="textBlack">
        <div align="right">标题:</div>
      </td>
      <td>
        <input type="text" name="txtTitle" size="52" class="textarea">
      </td>
    </tr>
    <tr>
      <td class="textBlack">
        <div align="right">分类:</div>
      </td>
      <td>
        <input type="text" name="txtSort" size="35" class="textarea">
        <input type="button" name="Submit2" class="buttonSkid" onclick="selectsort(txtSort);">
      </td>
    </tr>
    <tr>
      <td class="textBlack" valign="top">
        <div align="right">正文:</div>
      </td>
      <td>
        <textarea name="txtContent" rows="15" cols="50" class="textarea"></textarea>
  &n