forked from palmerr23/ESP32-OTA-and-File-Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilecode.h
50 lines (36 loc) · 953 Bytes
/
filecode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* filesystem code - local and via webserver
*/
#ifndef FILECODE_H_
#define FILECODE_H_
#define LITTLE_FS 0
#define SPIFFS_FS 1
#define FILESYSTYPE LITTLE_FS // Set to on or the other before compile
void fsList(void);
bool initFS(bool format, bool force);
extern String logStr;
extern char tempBuf[];
#if FILESYSTYPE == LITTLE_FS
#include "LittleFS.h"
#define FILESYS LittleFS
extern char fsName[];
#else
#include "FS.h"
#include <SPIFFS.h>
#define FILESYS SPIFFS
extern char fsName[];
#endif
//holds the current upload
extern File fsUploadFile;
void handleFileSysFormat();
String getContentType(String filename);
bool handleFileRead(String path);
// uses edit mode uploader
void handleFileUpload();
void handleFileDelete();
void handleFileCreate();
// main page JS scripts
extern const char edit_script[] PROGMEM;
// generate HTML for main page
void handleMain();
#endif