File tree 1 file changed +0
-44
lines changed
libraries/WebServer/examples/UploadHugeFile
1 file changed +0
-44
lines changed Original file line number Diff line number Diff line change @@ -42,50 +42,6 @@ void returnFail(String msg) {
42
42
server.send (500 , " text/plain" , msg + " \r\n " );
43
43
}
44
44
45
- void printDirectory () {
46
- if (!server.hasArg (" dir" )) {
47
- return returnFail (" BAD ARGS" );
48
- }
49
- String path = server.arg (" dir" );
50
- if (path != " /" && !SD.exists ((char *)path.c_str ())) {
51
- return returnFail (" BAD PATH" );
52
- }
53
- File dir = SD.open ((char *)path.c_str ());
54
- path = String ();
55
- if (!dir.isDirectory ()) {
56
- dir.close ();
57
- return returnFail (" NOT DIR" );
58
- }
59
- dir.rewindDirectory ();
60
- server.setContentLength (CONTENT_LENGTH_UNKNOWN);
61
- server.send (200 , " text/json" , " " );
62
- WiFiClient client = server.client ();
63
-
64
- server.sendContent (" [" );
65
- for (int cnt = 0 ; true ; ++cnt) {
66
- File entry = dir.openNextFile ();
67
- if (!entry) {
68
- break ;
69
- }
70
-
71
- String output;
72
- if (cnt > 0 ) {
73
- output = ' ,' ;
74
- }
75
-
76
- output += " {\" type\" :\" " ;
77
- output += (entry.isDirectory ()) ? " dir" : " file" ;
78
- output += " \" ,\" name\" :\" " ;
79
- output += entry.path ();
80
- output += " \" " ;
81
- output += " }" ;
82
- server.sendContent (output);
83
- entry.close ();
84
- }
85
- server.sendContent (" ]" );
86
- dir.close ();
87
- }
88
-
89
45
void handleNotFound () {
90
46
String message = " File Not Found\n\n " ;
91
47
message += " URI: " ;
You can’t perform that action at this time.
0 commit comments