access| Upload | No components The following code has no specifications, and some features have not been completed, there is the master can modify it, packaged into a class is more for the benefit of the public, or later I will do the time. There are any mistakes or suggestions please make sure to send me e-mail:sobina@21cn.com, thank you.
Okay, less to say more, this example tests through in W2kserver,iis5,sql SERVER7.
If you do not understand can go to the essence of the "image" or "picture" keyword to find the answer, or write to me.
Example a total of three files: upload.htm (Upload interface)
process.asp (processing program)
Showimg.asp (show image)
Database: Create a new table named Imgtest in the pubs database
Field Name Type length
-----------------------------------------------------
ID Int (autonumber)
IMG Iamge (Access is OLE)
Imginfo NCHAR 50
The following are the code for three files:
Upload.htm
---------------------------------------------------------------------
<title>untitled document</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<style type= "Text/css" >
<!--
td {FONT-SIZE:9PT}
A {color: #000000; Text-decoration:none}
a:hover {Text-decoration:underline}
. tx {height:16px; width:30px; border-color:black black #000000; border-top-width:0px;
border-right-width:0px; border-bottom-width:1px; border-left-width:0px; font-size:9pt;
Background-color: #eeeeee; Color: #0000FF}
. bt {font-size:9pt; border-top-width:0px; border-right-width:0px; border-bottom-width:0px;
border-left-width:0px; height:16px; width:80px; Background-color: #eeeeee; Cursor:hand}
. tx1 {height:20px; width:30px; font-size:9pt; border:1px solid; Border-color:black Black
#000000; Color: #0000FF}
-->
</style>
<body bgcolor= "#FFFFFF" text= "#000000" >
<form name= "Form1" method= "Post" action= "process.asp" enctype= "Multipart/form-data" >
<table width= "71%" border= "1" cellspacing= "0" cellpadding= "5" align= "center"
bordercolordark= "#CCCCCC" bordercolorlight= "#000000" >
<tr bgcolor= "#CCCCCC" >
<TD height= "align=" "left" valign= "Middle" bgcolor= "#CCCCCC" > Sobina
Graphics and text upload interface </td>
</tr>
<tr align= "left" valign= "Middle" bgcolor= "#eeeeee" >
<TD bgcolor= "#eeeeee" > <br>
</td>
</tr>
<TR align= "center" valign= "Middle" >
<TD align= "left" id= "Upid" height= "122" >
<p> Image path:
<input type= "file" Name= "img" style= "width:400" class= "tx1" "value=" ">
</p>
<p> image description:
<input type= "text" name= "Imginfo" >
</p>
</td>
</tr>
<TR align= "center" valign= "Middle" bgcolor= "#eeeeee" >
<TD bgcolor= "#eeeeee"