SetHTTPFormField()

Description

Sets up a field in the web form which will be sent to the server once an upload is initiated. You can set multiple fields by calling this method mutliple times.

Syntax

.SetHTTPFormField(fieldName, fieldValue);

.SetHTTPFormField(fieldName, blobValue, optional fileName);

Parameters

<string> fieldName: specifies the name of the field which can later be used on the server to retrieve the field value.
<string> fieldValue: specifies the field value.

<string> fieldName: specifies the name of the field which can later be used on the server to retrieve the blob.
<blob> blobValue: specifies the binary data to be uploaded.
<string> fileName: specifies a name to be used when saving the binary on the server.

Return value

bool

true indicates success. false indicates failure.

When false is returned, check ErrorCode or ErrorString for error information.

See also

How to upload multiple files at a time

ClearAllHTTPFormField()

Example

JavaScript:

DWObject.ClearAllHTTPFormField();
DWObject.SetHTTPFormField("PDFFileName", "test.pdf");
/* Get action page path */
var CurrentPathName = unescape(location.pathname); 
var CurrentPath = CurrentPathName.substring(0, CurrentPathName.lastIndexOf(";") + 1);
var strActionPage = CurrentPath + "SaveToFile.aspx";
DWObject.HTTPUploadAllThroughPostAsMultiPageTIFF(
  "www.dynamsoft.com",
  strActionPage,
  "test.tiff"
);

Action Page Part

System.Web.HttpContext.Current.Request.Form["PDFFileName"];
Is this page helpful?

Leave a Reply

Your email address will not be published.