OpenWrt Forum Archive

Topic: LuCI file browser

The content of this topic has been archived on 26 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi gyus,

I'd like to be able to browse a given directory on my router through the web browser.

I have CHAOS CALMER (15.05, r46767) installed and LuCI WebUI works fine on http://192.168.1.1/cgi-bin/luci.

But as soon as I type in something different (e.g. /cgi-bin/test) a "Forbidden" message pops out, although I have chmod-ed the folder with 777.

Is it possible to browse the content of a given folder or has anyone used the filebrowser.lua package?

Cheers

I used the file browser before I made my lua ftp server. You can easily make it available to the ui by editing the "/usr/lib/lua/luci/controller/admin/filebrowser.lua".

edit the index function like so ....

function index()
    entry( {"admin", "filebrowser"}, alias("admin", "filebrowser","filebrowser"), _("File Browser"), 20).index = true
    entry( {"admin", "filebrowser","filebrowser"}, template("cbi/filebrowser"), _("Browser"), 3)
end

then just reboot or remove the "/tmp/luci-indexcache" and refresh the browser. As i recall, the functionality was very basic but it was functional

cheers

Thanks for the reply,

I've tested your suggestion, but without visible success sad

1. Installed uhttpd-mod-lua
2. Replaced the code in /usr/lib/lua/luci/controller/admin/filebrowser.lua
3. Added option lua_prefix '/lua/'
          option lua_handler '/usr/lib/lua/luci/controller/admin/filebrowser.lua'
in the /etc/config/uhttpd file
4. /etc/init.d/uhttpd restart

But when I type http://serverIP/lua This webpage is not available ERR_CONNECTION_REFUSED comes out.

Do I need to do anything else or organize the filebrowser files and dirs differently?

Cheers

Just create a symlink to the directory you want to share under /www like this:

# ln -s /path/to/shared/folder /www/sharename

And you can access it like this: http://192.168.1.1/sharename

arokh wrote:

Just create a symlink to the directory you want to share under /www like this:

# ln -s /path/to/shared/folder /www/sharename

And you can access it like this: http://192.168.1.1/sharename


This has worked tremendously well smile
Thanks a lot.

The discussion might have continued from here.