Skip to content

Commit 48253ab

Browse files
authored
Update index.html
1 parent b436a6c commit 48253ab

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

index.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<html lang="en">
33
<meta charset="UTF-8">
44
<meta name="viewport" content="width=device-width, initial-scale=1.0">
5-
<title>File uploading</title>
5+
<title>Dear Photos</title>
66
<body>
7-
<h1>File uploading</h1>
7+
<h1>Dear Photos</h1>
88
<input type="file" id="upload">
99
<button onclick="sendFile()">Upload</button>
1010
<p id="status"></p>
@@ -30,12 +30,15 @@ <h1>File uploading</h1>
3030
if (xhr.status === 200) {
3131
statusText.innerText = "Success!";
3232
} else {
33-
statusText.innerText = "Error.";
33+
statusText.innerText = "Error: " + xhr.status + " " + xhr.responseText;
3434
}
3535
};
3636

3737
xhr.onerror = function () {
38-
statusText.innerText = "Network error.";
38+
statusText.innerText = "Network error.\n" +
39+
"Status: " + xhr.status + "\n" +
40+
"StatusText: " + xhr.statusText + "\n" +
41+
"Response: " + (xhr.responseText || "No response");
3942
};
4043

4144
xhr.withCredentials = true;

0 commit comments

Comments
 (0)