Skip to content

Commit f8c84df

Browse files
committed
fix create using browser
1 parent 531974a commit f8c84df

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

examples/MassStorage/msc_esp32_file_browser/msc_esp32_file_browser.ino

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,12 @@ Adafruit_SPIFlash flash(&flashTransport);
6161
// file system object from SdFat
6262
FatFileSystem fatfs;
6363

64-
//FatFile root;
65-
//FatFile file;
66-
6764
// USB Mass Storage object
6865
Adafruit_USBD_MSC usb_msc;
6966

7067
bool fs_formatted; // Check if flash is formatted
7168
bool fs_changed; // Set to true when PC write to flash
7269

73-
7470
const char* host = "esp32fs";
7571
WebServer server(80);
7672
//holds the current upload
@@ -330,7 +326,7 @@ void handleFileCreate() {
330326
if (exists(path)) {
331327
return server.send(500, "text/plain", "FILE EXISTS");
332328
}
333-
File file = fatfs.open(path, O_WRITE);
329+
File file = fatfs.open(path, O_WRITE | O_CREAT);
334330
if (file) {
335331
file.close();
336332
} else {

0 commit comments

Comments
 (0)