XML skills Upload file 1

Source: Internet
Author: User
Tags biztalk
XML tip file Upload type: XML/Biztalk overview This article describes an example of using XML tips to upload files. this method does not have any restrictions in traditional methods. This example describes how to apply the MSXML3.0 and ADOStream objects to implement the new XML skills file Upload
Type:XML/Biztalk

Overview

This article describes an example of using XML to upload files. this method does not have any restrictions in traditional methods. This example describes how to apply the MSXML3.0 and ADO Stream objects to implement this new Upload method. There are many benefits, such as the absence of dedicated Upload components.


Introduction

In order to obtain the upload function in HTML webpages, we can apply the following FORM pattern on the client:

<Form name = 'myform' ACTION = 'targeturl. asp 'ENCTYPE = 'multipart/form-data' METHOD = 'post'>
<Input type = 'file' NAME = 'myfile'>
<Input type = 'submit 'VALUE = 'upload file'>
</FORM>

This kind of plan has many restrictions on the client and server applications. First, we must apply the POST method because the GET method cannot process such form data. In addition, there is no way to trigger a POST action without applying a form. After the data is sent to the form processing program, the browser will load the processing program as a new page, and then the application will see a page conversion process that is not desirable.

The ENCTYPE attribute defines the MIME encoding method for the form. The "multipart/form-data" must be applied to the ENCTYPE attribute of the form for file upload ". Setting this attribute as "multipart/form-data" creates a POST buffer (composite structure) that is different from the traditional structure. ASP Request objects cannot access such form content. Therefore, we can use the Request. binaryRead method to visit the data, but we cannot use the script language to complete this. The Request. binaryRead method returns a VTarray-type data (a Variant array containing only one byte of unsigned characters ). However, the scripting language can only process Variant data. To determine the title, you can only use a dedicated ASP Upload component or an ISAPI extended program, such as CPSHOST. DLL. This is a design restriction.

New Upload plan

Follow these steps.
Client:

Use MSXML 3.0 to create an XML document
Create an XML node for binary content
Apply ADO Stream object to put uploaded file data into this node
The XMLHTTP object is used to send this XML document to the Web server.


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.