File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 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 ;
You can’t perform that action at this time.
0 commit comments