Skip to content

Commit 5739cbf

Browse files
Merge pull request #930 from dynamsoft-docs/preview
update to internal commit e40f1fa4
2 parents f8bc81e + 311ddb9 commit 5739cbf

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

_articles/hello-world/editing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,19 @@ APIs used:
124124
Dynamsoft.DWT.EnumDWT_ImageType.IT_PNG,
125125
Dynamsoft.DWT.EnumDWT_UploadDataFormat.Binary,
126126
"WebTWAINImage.png",
127-
onUploadSuccess,
128-
onUploadFailure
127+
onEmptyResponse,
128+
onServerReturnedSomething
129129
);
130130
} else {
131131
alert("There is no image in buffer.");
132132
}
133133
}
134134
135-
function onUploadSuccess() {
135+
function onEmptyResponse() {
136136
alert("Upload successful");
137137
}
138138
139-
function onUploadFailure(errorCode, errorString, sHttpResponse) {
139+
function onServerReturnedSomething(errorCode, errorString, sHttpResponse) {
140140
alert(sHttpResponse.length > 0 ? sHttpResponse : errorString);
141141
}
142142

_articles/hello-world/scan-settings.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,19 @@ function AcquireImage() {
9090
Dynamsoft.DWT.EnumDWT_ImageType.IT_PNG,
9191
Dynamsoft.DWT.EnumDWT_UploadDataFormat.Binary,
9292
"WebTWAINImage.png",
93-
onUploadSuccess,
94-
onUploadFailure,
93+
onEmptyResponse,
94+
onServerReturnedSomething,
9595
);
9696
} else {
9797
alert("There is no image in buffer.");
9898
}
9999
}
100100
101-
function onUploadSuccess() {
101+
function onEmptyResponse() {
102102
alert("Upload successful");
103103
}
104104
105-
function onUploadFailure(errorCode, errorString, sHttpResponse) {
105+
function onServerReturnedSomething(errorCode, errorString, sHttpResponse) {
106106
alert(sHttpResponse.length > 0 ? sHttpResponse : errorString);
107107
}
108108
</script>

_articles/hello-world/uploading.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ function upload() {
3939
Dynamsoft.DWT.EnumDWT_ImageType.IT_PNG,
4040
Dynamsoft.DWT.EnumDWT_UploadDataFormat.Binary,
4141
"WebTWAINImage.png",
42-
onUploadSuccess,
43-
onUploadFailure
42+
onEmptyResponse,
43+
onServerReturnedSomething
4444
);
4545
} else {
4646
alert("There is no image in buffer.");
4747
}
4848
}
4949

50-
function onUploadSuccess() {
50+
function onEmptyResponse() {
5151
alert('Upload successful');
5252
}
5353

54-
function onUploadFailure(errorCode, errorString, sHttpResponse) {
54+
function onServerReturnedSomething(errorCode, errorString, sHttpResponse) {
5555
alert(sHttpResponse.length > 0 ? sHttpResponse : errorString);
5656
}
5757
```
@@ -116,19 +116,19 @@ Following this guide, your `HelloWorld.html` should look similar to this:
116116
Dynamsoft.DWT.EnumDWT_ImageType.IT_PNG,
117117
Dynamsoft.DWT.EnumDWT_UploadDataFormat.Binary,
118118
"WebTWAINImage.png",
119-
onUploadSuccess,
120-
onUploadFailure
119+
onEmptyResponse,
120+
onServerReturnedSomething
121121
);
122122
} else {
123123
alert("There is no image in buffer.");
124124
}
125125
}
126126
127-
function onUploadSuccess() {
127+
function onEmptyResponse() {
128128
alert('Upload successful');
129129
}
130130
131-
function onUploadFailure(errorCode, errorString, sHttpResponse) {
131+
function onServerReturnedSomething(errorCode, errorString, sHttpResponse) {
132132
alert(sHttpResponse.length > 0 ? sHttpResponse : errorString);
133133
}
134134
</script>

_articles/info/api/WebTwain_IO.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ HTTPUpload(
14901490

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

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

14951495
- `errorCode` The error code.
14961496
- `errorString` The error string.
@@ -2070,6 +2070,10 @@ httpUploadBlob(
20702070
- `name`: The name of header.
20712071
- `value`: The value of header.
20722072

2073+
**Return Values**
2074+
2075+
A Promise object of the response that is resolved based on the `responseType` parameter.
2076+
20732077
**Availability**
20742078

20752079
<div class="availability">

assets/HelloWorld-Code.zip

23 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)