Two files uploaded, only 30 lines of code

Source: Internet
Author: User
Tags exit
Upload <%
' Upload.asp
Function Intmin (n,y)
If N<y and N>0 Then
Intmin=int (N)
ElseIf y>0 Then
Intmin=int (y)
Else
Intmin=n
End If
End Function

Function Getformvalue (Name)
Dim Formsize,formdata,dataheader,datastart,dataend,formnamestart,formnameend,formname,firstfilter
Formsize=request.totalbytes ()
Formdata=request.binaryread (Formsize)
Firstfilter=true
For I=1 to Len (Name)
TMP=TMP&AMP;CHRB (AscB) (Mid (name,i,1))
Next
Name=tmp
Dataend=0
Datastart=0
Do While formsize>0
FORMDATA=RIGHTB (formdata,formsize-dataend-datastart+1)
Formsize=formsize-dataend-datastart+1
Dataheader=leftb (FORMDATA,INSTRB (FORMDATA,CHRB) &AMP;CHRB (10))-1)
DATASTART=INSTRB (FORMDATA,CHRB) &AMP;CHRB (a) &AMP;CHRB &AMP;CHRB (10)) +4
DATAEND=INSTRB (Datastart+1,formdata,dataheader)-datastart
If datastart<0 or dataend<=0 Then Exit do
FILTEREDDATA=MIDB (formdata,datastart,dataend-1)
FORMNAMESTART=INSTRB (FORMDATA,CHRB (AscB ("n")) &chrb (AscB ("a")) &chrb (AscB ("M")) &chrb (AscB ("E")) & ChrB (AscB ("=")) &chrb (AscB ("" "))) +6
Formnameend=intmin (InStrB (FORMNAMESTART,FORMDATA,CHRB) &chrb-formnamestart-1,instrb (FormNameStart, FORMDATA,CHRB (AscB (";")) -FORMNAMESTART-1)
FORMNAME=MIDB (Formdata,formnamestart,formnameend)
If Name=formname Then
Getformvalue=filtereddata
Exit Function
End If
Loop
getformvalue=name& "Not found!"
End Function
Response.BinaryWrite (Getformvalue ("LoadFromFile")) ' This loadfromfile is the table Single-name ~
%>



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.