No components upload pictures to SQL Server database

Source: Internet
Author: User
Tags strlen
In the no component upload I just tried to succeed, so provide code for everyone to share.
* addemployee.asp * *
<title> Staff's Home </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<link rel= "stylesheet" href= ". /css/site_css.css "type=" Text/css ">
<script language= "JavaScript" >
<!--
Select Category
///////////////////////////////////////////////////////////////////////
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
}
}
///////////////////////////////////////////////////////////////////////
Legality check
function IsOK (thisform) {
var strtemp,strvalue,strlen,strexname
if (thisform.txttitle.value== "") {
Alert ("Hint: Title cannot be empty, please enter correctly")
ThisForm.txtTitle.focus ()
return False
}
if (thisform.txtsort.value== "") {
Alert ("Hint: Please select categories correctly")
ThisForm.txtSort.focus ()
return False
}
/* Check Picture type * *
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 ("Please select a JPG or GIF file!") ")
return False
}
return True
}
}
-->
</script>
<body bgcolor= "#FFFFFF" text= "#000000" leftmargin= "1" topmargin= "1" >
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.