Skip to content

[FAQ][High] upload-multiple-files-at-a-time.md: HTTPUpload() sample shows wrong arity; number passed where string expected #1031

Description

@lyzhang0113

File: _articles/faq/upload-multiple-files-at-a-time.md
Severity: High (arity), Low (type mismatch)

Found via a full FAQ accuracy audit cross-referencing the FAQ set against the API reference docs (_articles/info/api/).

Issue 1 (High)

Claim: DWTObject.HTTPUpload("http://localhost:90/saveUploadedJPG.aspx", onEmptyResponse, onServerReturnedSomething) — a 3-arg call.

Contradicting doc: _articles/info/api/WebTwain_IO.md (lines ~1446-1467) defines only 6- and 7-parameter HTTPUpload() overloads requiring indices, type, and dataFormat. No 3-arg overload exists.

Proposed fix: DWTObject.HTTPUpload(url, [], Dynamsoft.DWT.EnumDWT_ImageType.IT_JPG, Dynamsoft.DWT.EnumDWT_UploadDataFormat.Binary, onEmptyResponse, onServerReturnedSomething).

Issue 2 (Low)

Claim: DWTObject.SetHTTPFormField("UploadedImagesCount", DWTObject.HowManyImagesInBuffer) passes a number.

Contradicting doc: WebTwain_IO.md types SetHTTPFormField(name: string, value: string): boolean — the second parameter is documented as string. HowManyImagesInBuffer is typed as number in WebTwain_Buffer.md. JS coerces this automatically so it works in practice, but it doesn't match the documented signature.

Proposed fix: DWTObject.SetHTTPFormField("UploadedImagesCount", DWTObject.HowManyImagesInBuffer.toString());.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions