grblHAL / Plugin_WebUI

ESP3D-WEBUI backend for networking capable drivers/boards with SD card support
Other
10 stars 0 forks source link

server URL only supports /upload to show files/directories list in the root of SD #3

Closed karoria closed 2 years ago

karoria commented 2 years ago

Hi Terje! This is to draw your attention that while I am adding more features to my webUI, I came to know that the URL only supports the listing of files and directories in the root of SD card. I want to go inside a directory to support files in it also, which somehow doesn't work. The fluidNC ESP-3D webui also supports URL of multi-level for directory structure (I came to know that it can be fetched by adding 'SD/', which is not supported in our server.c. As I am not good at C or C++, I could not find what is missing. It is well defined but somewhere the function breaks. Right now only /upload works. I mean "http://serverIP/upload" shows files list at root of SD card. I can't go one or two level inside any directory. Something like "http://serverIP/SD/dir1/dir2" should open a list of files of SD in that path. I hope I could explain you. BTW, thanks for adding my webUI link to the plugin_webUI description. Regards, Ravi

karoria commented 2 years ago

Hi Terje. Have you checked the matter? I can understand you must be too busy.

terjeio commented 2 years ago

Something like "http://serverip/SD/dir1/dir2" should open a list of files of SD in that path.

A listing in WebUI json-format or something else (perhaps there is a standard http response for "opening" a directory)?

The WebUI uses the path parameter to specify the directory for the upload URL, eg http://10.0.0.119/upload?path=/New%20folder/&PAGEID= Code has to be added to list the files based on the URL only - possibly in httpd.c depending on how the listing should be formatted.

karoria commented 2 years ago

I am looking for only listing in json format just like it lists files on root of sd when we open url http://serverIP/upload I will parse it from json. The only issue is to create url to list files inside a directory tree. I think fluidNC has that implemented with http://serverIP/SD/dir1/ Kindly go through last lines (942 to 948) of server.c of webUI. There is already provision of such path but I can't get where it is broken. I will try your example url today. If that works, nothing needs to be done.

karoria commented 2 years ago

OK. Just checked with 'path' parameter as per your example and it works nicely. Thanks for time.