-
Notifications
You must be signed in to change notification settings - Fork 1.3k
SPIFFSEditor not displaying file contents on ESP32 with LittleFS #1210
Comments
I have noticed the same behaviour, though the fork we use (from @Aircoookie) works correctly on ESP32 but fails on ESP32-S2 and ESP32-S3. |
After I had to introduce that "/" into multiple different places, I searched for a more generic approach:
here in between line 465 and 466: ESPAsyncWebServer/src/SPIFFSEditor.cpp Lines 464 to 468 in f71e3d4
This makes the filenames in the left frame of the SPIFFSEditor being displayed as "/index.html" instead of "index.html" and also the subsequent actions like Save, Delete, etc. use then the correct filename including "/". So from my point of view this could be a real solution. However I don't yet understand, why it's working in Aircookies fork. So there might be also another solution. |
@steff393 You may want to use '/' instead of "/". |
Thank you for finding what seems like a good solution! My hunch is that the LittleFS library by lorol returns filenames with leading |
Hi to all. |
I digged a little deeper, to find out, why
But there is also another function Therefore I think the best solution would be:
On my system it works well and I'm going to raise a PR accordingly. |
…o-dev#1210) (cherry picked from commit 2e744c5)
Hi,
thanks for this great library. I used it a lot on ESP8266. But now with ESP32 and LittleFS I found that the SPIFFSEditor doesn't display the file contents (only the file names on the left frame).
I got the error message:
[E][vfs_api.cpp:29] open(): myFile.txt does not start with /
The following change (i.e. adding the "/" in front of the filename) fixes this behavior:
ESPAsyncWebServer/src/SPIFFSEditor.cpp
Line 397 in f71e3d4
request->_tempFile = _fs.open(String("/") + request->arg("edit"), "r");
But I'm not sure if this is really the solution or only a quick workaround. What is your opinion?
The text was updated successfully, but these errors were encountered: