-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
In the example 2 I could not download the uploaded file and could not delete the uploaded file.
I traced the issue to: line 99: if(!SPIFFS.exists(filename)
the filename is defined with: const char *fileName = request->getParam("name")->value().c_str(); (line 94)
I did a rather ugly workauround with the following code:
char *cstr1 = (char*)malloc(strlen(request->getParam("name")->value().c_str())+1);
strcpy(cstr1,"/");
strcat(cstr1, fileName);
if (!SPIFFS.exists(cstr1)){
.
.
request->send(SPIFFS, cstr1, "application/octet-stream");
.
.
SPIFFS.remove(cstr1);
.
.
free(cstr1);
Metadata
Metadata
Assignees
Labels
No labels