Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions _articles/hello-world/editing.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,19 @@ APIs used:
Dynamsoft.DWT.EnumDWT_ImageType.IT_PNG,
Dynamsoft.DWT.EnumDWT_UploadDataFormat.Binary,
"WebTWAINImage.png",
onUploadSuccess,
onUploadFailure
onEmptyResponse,
onServerReturnedSomething
);
} else {
alert("There is no image in buffer.");
}
}

function onUploadSuccess() {
function onEmptyResponse() {
alert("Upload successful");
}

function onUploadFailure(errorCode, errorString, sHttpResponse) {
function onServerReturnedSomething(errorCode, errorString, sHttpResponse) {
alert(sHttpResponse.length > 0 ? sHttpResponse : errorString);
}

Expand Down
8 changes: 4 additions & 4 deletions _articles/hello-world/scan-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,19 @@ function AcquireImage() {
Dynamsoft.DWT.EnumDWT_ImageType.IT_PNG,
Dynamsoft.DWT.EnumDWT_UploadDataFormat.Binary,
"WebTWAINImage.png",
onUploadSuccess,
onUploadFailure,
onEmptyResponse,
onServerReturnedSomething,
);
} else {
alert("There is no image in buffer.");
}
}

function onUploadSuccess() {
function onEmptyResponse() {
alert("Upload successful");
}

function onUploadFailure(errorCode, errorString, sHttpResponse) {
function onServerReturnedSomething(errorCode, errorString, sHttpResponse) {
alert(sHttpResponse.length > 0 ? sHttpResponse : errorString);
}
</script>
Expand Down
16 changes: 8 additions & 8 deletions _articles/hello-world/uploading.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ function upload() {
Dynamsoft.DWT.EnumDWT_ImageType.IT_PNG,
Dynamsoft.DWT.EnumDWT_UploadDataFormat.Binary,
"WebTWAINImage.png",
onUploadSuccess,
onUploadFailure
onEmptyResponse,
onServerReturnedSomething
);
} else {
alert("There is no image in buffer.");
}
}

function onUploadSuccess() {
function onEmptyResponse() {
alert('Upload successful');
}

function onUploadFailure(errorCode, errorString, sHttpResponse) {
function onServerReturnedSomething(errorCode, errorString, sHttpResponse) {
alert(sHttpResponse.length > 0 ? sHttpResponse : errorString);
}
```
Expand Down Expand Up @@ -116,19 +116,19 @@ Following this guide, your `HelloWorld.html` should look similar to this:
Dynamsoft.DWT.EnumDWT_ImageType.IT_PNG,
Dynamsoft.DWT.EnumDWT_UploadDataFormat.Binary,
"WebTWAINImage.png",
onUploadSuccess,
onUploadFailure
onEmptyResponse,
onServerReturnedSomething
);
} else {
alert("There is no image in buffer.");
}
}

function onUploadSuccess() {
function onEmptyResponse() {
alert('Upload successful');
}

function onUploadFailure(errorCode, errorString, sHttpResponse) {
function onServerReturnedSomething(errorCode, errorString, sHttpResponse) {
alert(sHttpResponse.length > 0 ? sHttpResponse : errorString);
}
</script>
Expand Down
6 changes: 5 additions & 1 deletion _articles/info/api/WebTwain_IO.md
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ HTTPUpload(

`onEmptyResponse`: A callback function that is executed if the response is empty.

`onServerReturnedSomething`: A callback function that is executed if the response is not empty.
`onServerReturnedSomething`: A callback function that is executed if the response is not empty. The accepted response type is `string`.

- `errorCode` The error code.
- `errorString` The error string.
Expand Down Expand Up @@ -2070,6 +2070,10 @@ httpUploadBlob(
- `name`: The name of header.
- `value`: The value of header.

**Return Values**

A Promise object of the response that is resolved based on the `responseType` parameter.

**Availability**

<div class="availability">
Expand Down
Binary file modified assets/HelloWorld-Code.zip
Binary file not shown.