Upload | No components part of the code according to transformation code adaptation!!
Upload.htm
<meta http-equiv= "Content-language" content= "ZH-CN" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<meta name= "generator" content= "Microsoft FrontPage 4.0" >
<meta name= "ProgId" content= "FrontPage.Editor.Document" >
<title>new Page 1</title>
<link rel= "stylesheet" href= ". /public/css.css ">
<script language= "JavaScript" >
<!--
function Checkform1 ()
{
if (form1.names.value== "")
{
Alert ("Please enter a name!") ")
Form1.names.focus ()
return False
}
if (form1.pic.value== "")
{
Alert ("Please select a picture!") ")
Form1.pic.focus ()
return False
}
return True
}
-->
</script>
<body>
<table border= "0" width= "100%" >
<form name= "Form1" enctype= "Multipart/form-data" action= "upload.asp" method= "POST" onsubmit= "return Checkform1 ()" >
<tr>
<TD width= "100%" colspan= "2" >
<p align= "center" ><b> Upload Example </b></td>
</tr>
<tr>
<TD width= "40%" align= "right" > name:</td>
<TD width= "60%" ><input type= "text" name= "names" size= "maxlength=" class= "" INPUT1 "></td>
</tr>
<tr>
<TD width= "40%" align= "right" > Pattern:</td>
<TD width= "60%" ><input type= "file" name= "pic" size= "" maxlength= "" class= "input1" "onblur=" Document.all.picview.src=document.all.pic.value "></td>
</tr>
<tr>
<TD width= "40%" align= "right" > </td>
<TD width= "60%" ><input type= "Submit" value= "O K" class= "inputbtn" ></td>
</tr>
<tr>
<TD width= "100%" align= "center" colspan= "2" >
Image Preview (after selecting a picture, click anywhere on the page to preview) <br>
</td>
</tr>
</form>
</table>
</body>
-----upload.asp
<!--#include file= "savefile.asp"-->
<%
Set objstream = Server.CreateObject ("ADODB. Stream ")
Objstream.mode=3
objStream.Type = 1
objStream.Open
Objstream.write Request.BinaryRead (request.totalbytes)
names= GetValue ("names", True, "")
Pic=getvalue ("Pic", False, "upimg/")
objStream.Close
Response.Write ("names:" +names)
Response.Write ("File uploaded!") +pic+ ")")
%>
-----savefile.asp
<%
Dim Stream1,stream2,istart,iend,filename
Istart=1
VBENTER=CHR (&CHR) (10)
function GetValue (fstr,foro,paths) ' Fstr for received name, Foro boolean false for file upload, true to normal field, path for upload file
If Foro Then
Getvalue= ""
Istart=instring (ISTART,FSTR)
Istart=istart+len (FSTR) +5
Iend=instring (istart,vbenter+ "-------------------