Dudu without component upload routines

Source: Internet
Author: User
Tags chr microsoft frontpage
Upload | no component ' #####################################################################
' Remark: I did not verify, provided to you a reference! Please verify by yourselves
' Welcome to the wonderful program code you think is good
' Gale (Xuankong) 2000. 12. 8
'#####################################################################
Title: or upload it with my component-free file, as with the ASPCN component, here is a routine:
Author: Dudu (DUSJ)
Time: 2000-12-7 09:48:00
Number of reads: 8
Detailed information:
-----------------------------
The contents of the Form Fill page:
-----------------------------
<meta name= "Author" content= "Sander Duivestein" >
<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> upload a local file to the database </title>
<body>
<font size= "2" size= "2" ><br>
</font>
<form name= "Frmupload" method= "post" enctype= "Multipart/form-data" action= "upload.asp" >
<table cellspacing= "0" cellpadding= "0" width= "490" >
<tr>
&LT;TD width= "167" >
<p align= "right" ><font size= "2" size= "2" > Please select File:</font></p>
</td>
&LT;TD width= "319" ><font size= "2" size= "2" ><input type= "file" Name= "Vfilename" ></font></td >
</tr>
<tr>
&LT;TD align= "Right" width= "167" ><font size= "2" size= "2" > Document description 1:</font></td>
&LT;TD width= "319" ><input name= "shuoming" size= "></font></td>"
</tr>
<tr>
&LT;TD align= "Right" width= "167" ><font size= "2" size= "2" > Document description 2:</font></td>
&LT;TD width= "319" ><input name= "shuoming_2" "size=" onchange= "Isdate1" (Document.frmUpload.dengji) "&LT;/TD" >
</tr>
&LT;TD width= "167" ></td>
&LT;TD width= "319" >
<p align= "left" ><font size= "2" size= "1" ><input type= "Submit" style= "Background-image:url (' images/ Back.jpg '); Cursor:hand; Font-sizd:smaller; left:0px; width:94; top:5px; Height:25 "value=" Upload "style=" background-image:url (' images/back.jpg '); Cursor:hand; Font-sizd:smaller; left:0px; width:94; top:5px; Height:25 "Size=" ></font></p>
</td>
<tr>
&LT;TD colspan= "2" align= "right" width= "487" ></td>
</tr>
</table>
</form>
</body>


----------------------------------
Content of Upload.asp:
----------------------------------
<%
Response.Buffer = TRUE
Response.Clear
ByteCount = Request.TotalBytes
Requestbin = Request.BinaryRead (ByteCount)
' Response.BinaryWrite Requestbin
' Get all the contents of the form
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Uploadrequest
Set uploadrequest = CreateObject ("Scripting.Dictionary")
' Uploadrequest structure will be used to store forms

Posbeg = 1
Posend = InstrB (Posbeg,requestbin,stob (Chr (13)))
Boundary = MidB (Requestbin,posbeg,posend-posbeg)
' Ask for a separate string between fields (that is,-----------------------------7d029e347d8)
Boundarypos = InstrB (1,requestbin,boundary)

Do Until (BOUNDARYPOS=INSTRB (Requestbin,boundary & Stob ("--)")
' members variable of the objects are put in a Dictionary object
Dim Uploadcontrol
Set Uploadcontrol = CreateObject ("Scripting.Dictionary")
' Get ' object name
Pos = InstrB (Boundarypos,requestbin,stob ("Content-disposition"))
Pos = InstrB (Pos,requestbin,stob ("Name="))
Posbeg = pos+6
Posend = InstrB (Posbeg,requestbin,stob (Chr (34)))
Name = Btos (MidB (Requestbin,posbeg,posend-posbeg))
Posfile = InstrB (Boundarypos,requestbin,stob ("Filename="))
Posbound = InstrB (posend,requestbin,boundary)
' Response.Write ' ' Response.Write ' name= ' &name& ' <BR> '
' Name is the name of the table item
' Test if object is of file type
If posfile<>0 and (Posfile<posbound) Then
Posbeg = Posfile + 10
Posend = InstrB (Posbeg,



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.