forked from Spritetm/libesphttpd
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional cgi functions available "as is" for ESP32 VFS static file serving and file uploading #23
Comments
Wow very cool man. A pull request would be great. I’ve thought about such a
cgi plug-in after using the vfs a bit. Imo this may be a better approach
than the current packed and compiled in case that libesphttp supports but
I’m guessing it depends on use case. Building the pages in is far simpler
than vfs I think if you are using a separate flash partition. Maybe vfs can
use a compiled in variable as well?
…On Thu, Jun 14, 2018 at 5:32 AM dmcnaugh ***@***.***> wrote:
Hi, I have developed a module to provide two additional cgi functions that
I have named
- cgiEspVfsHook
- cgiEspVfsUpload
as the names suggest and the title indicates, these provide for
serving static files from an ESP32 VFS, typically FAT FS mounted from an
attached SD card, and for HTTP file uploads to the ESP32 VFS.
The are used, for example, like:
{"/store", cgiEspVfsUpload, "/sdcard/www/store", NULL},
{"/public/
*", cgiEspVfsHook, "/sdcard", NULL}, {"*", cgiEspVfsHook, "/sdcard/www",
NULL},
Note:
- the VFS filesystem needs to already be mounted and available, that
isn't done in these modules
- the static files can be manually gzipped on the filesystem and will
be matched and served with the correct encoding header without having to
include the .gz extension in the URL
- code for supporting templates is included, but has never been
tested. Its modelled off an older version of httpdespfs.c
- some things might be specific to my requirements (like the returned
content at the completion of a file upload)
They work for me, so I am unlikely to put any more effort into maintaining
them or improving them. I am happy to provide them "as is" for you or
others to review/rework and better generalise into libesphttpd if anyone
finds them useful.
Is you want me to provide the code please tell me the best way to send it.
I could do it as a pull-request, or set it up as a gist, or anything else
you want to suggest.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#23>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABJ-AMCKFsP3mxYkO6vg_2uEptC14Q2Cks5t8i2cgaJpZM4Unnq5>
.
|
Merged, closing! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I have developed a module to provide two additional cgi functions that I have named
as the names suggest and the title indicates, these provide for serving static files from an ESP32 VFS, typically FAT FS mounted from an attached SD card, and for HTTP file uploads to the ESP32 VFS.
The are used, for example, like:
{"/store", cgiEspVfsUpload, "/sdcard/www/store", NULL},
{"/public/", cgiEspVfsHook, "/sdcard", NULL},
{"", cgiEspVfsHook, "/sdcard/www", NULL},
Note:
They work for me, so I am unlikely to put any more effort into maintaining them or improving them. I am happy to provide them "as is" for you or others to review/rework and better generalise into libesphttpd if anyone finds them useful.
Is you want me to provide the code please tell me the best way to send it. I could do it as a pull-request, or set it up as a gist, or anything else you want to suggest.
The text was updated successfully, but these errors were encountered: