Open janphoffmann opened 1 year ago
Same issue here, did this modification:
char dataPath[120] = {0}; memset(dataPath, 0x0, sizeof(dataPath)); strcpy(dataPath, gifFile.path());
and replaced all fileName to dataPath
That was my work around.
Thank you @janphoffmann & @viniciusro , I suspect libraries have changed since this was first published which is causing this. When I get time over the next couple weeks I will test and update.
I remplaced this line:
const char *fileName = request->getParam("name")->value().c_str();
with this:
String fileName = "/"+String(request->getParam("name")->value() );
Works like a charm. PR.
In my case, only '/' was missing before the file name.
if (!FFat.exists(String('/') + fileName)) {
request->send(FFat, String('/') + fileName, "application/octet-stream");
FFat.remove(String('/') + fileName);
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: