Pcdaspfileupload, Pcdaspfileupload 44 – Kofax DM API User Manual

Page 64

Advertising
background image

44

C

HAPTER

3

PCDASPFileUpload

PCDASPFileUpload

Use this object only from scripts running inside Active Server Pages
(ASP). This object is used to read from the ASP Request object and
write to the supplied

PCDPutStream

object.

Syntax

PCDASPFileUpload.

methodOrProperty

Usage

The PCDASPFileUpload object is a client-side interface (CSI) object
used to extract form data (specifically, uploaded files) from the
requested object when a form is submitted. When uploading a file,
ENCTYPE is set to “multipart/form-data.” A server-side component is
required to parse the information contained within the file. This utility
is used in conjunction with the

PCDPutDoc

object to write the data

stream to the document server.

To demonstrate the process, open the DM Webtop

UPLOADDSP.ASP

file. Locate the following line of code (where

[...]

markers indicate

that the same line of code continues on the next line of the page):

<FORM NAME=”uploadForm” ACTION=”<%= url %>?[...]

<%=Server.HTMLEncode(formArgs) %>” ENCTYPE=[...]

multipart/form-data METHOD=post>


<INPUT type=”button” Value=”<%=getString(([...]

isImportVersion)?”IMPORT_BUTTON1”:”UPLOAD_[...]

HEADER”)%>” onclick=”submitFunction()”>

Assuming that you are not using the DM Webtop Smart CheckIn/
CheckOut feature, when the form is submitted, your Internet browser
knows that you are uploading a file and will prompt you with an Input
File dialog box that contains a Browse button. Select the file to be
uploaded. The file itself is embedded as part of the form via the POST
method. In

UPLOADACT.ASP

, the PCDASPFileUpload component is

used to extract the file from the

REQUEST

object.

Advertising