How does one enable file upload and automatic categorization?

Source: Internet
Author: User
Tags date1 servervariables

Upload. asp
 <Form action = http: // <%= Request. ServerVariables (SERVER_NAME)>/wdread. asp method = post>
 <P>Topic: <Input type = text name = subject> <br>
Author: <Input name = author type = text> <br>
Release Date: <Input name = date1 type = text> <br>
Upload files: <Input type = file name = filename>
SentURL: <input type = hidden name = TargetURL value = http: // <%= Request. ServerVariables (SERVER_NAME)%>/Users/<%= Request. ServerVariables (LOGON_USER)%> Size = 20> <br>
  <Input type = submit value =OK> </P>
  </Form>


Wdread. asp

<Form enctype = multipart/form-Data action = http: // <%= Request. ServerVariables (SERVER_NAME)%>/Scripts/cpshost. dll? PUBLISH? Wdwriter. asp method = post name = form1>
Upload files: <Input type = file name = filename value = <%= Session (filename)%>
  <Input type = hidden name = TargetURL value = http: // <%= Request. ServerVariables (SERVER_NAME)%>/Users/wdls>

 <Input type = button name = upload value =OK>
  </Form>


  <Scripts language = VBScript>

'Form fields should be uploadedFilenameAndUpload. aspCompare the domain values in the program,Because inUpload. aspThe file name entered in this program is preset to the form fieldFilename,Once the client re-enters the new file name, submit it for confirmation.,Make the programWdwriter. aspThe name of the file written to the database is different from the actual uploaded file name.,Webpage connection Error.Judge here,If the two are equal,Upload now,Otherwise, cancel the operation..
  <!--

Sub upload_onclick ()

Set myformdomainmetadata Doc ument. form1

Tmp = myform. filename. value

    If strcomp (tmp, <%= Session

 (Filename)%>) = 0 then

Form1.submit

Else
     MsgboxOh,The file name you entered is incorrect.,Enter again!

End if
 End sub
-->
  </Scripts>

Wdwriter. asp
<%

Set mydata = Server. CreateObject (ADODB. Connection) mydata. Open DSN = xczh; UID = sa; PWD =;

'Open Database.

Date1 = session (date1)

 'Returns the value of each form field..Time taken.
Subject = session (subject)

 'Retrieve file topic.
Author = session (subject)

'Author.
Filename = session (filename)

'Get File Name.
  TargetURL = session (TargetURL)

'Obtain the physical address of the file stored in the server.

  Sqlstr = insert into wdlsb values (&Sn&,&Subject&',&Date1&',&Filename&',&TargetURL&',&Author&')

'Write database and save.
  Mydata. Execute (sqlstr)
%>

[1]

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.