Embedio: AutoIndex on EmbedIO?

Created on 24 Oct 2017  路  11Comments  路  Source: unosquare/embedio

Is there anyway to configure EmbedIO to whenever it hits a directory which does not have html file, list all the files and folder in that directory instead?

(Something similar to nginx's autoindex)

enhancement

All 11 comments

Makes sense. Working on it.

Working on feature DirectoryBrowser to StaticFileModule.

Hey @thebitbrine , can you take a look in the changes from PR #104?

New nuget published. Version 1.11.0.

Pretty nice!
All it needs is a nice theme which indeed i'll take care of but i'll need some guidance about sending custom responses, have looked through the code but couldn't figure it out.

Anyway this is how i imagine the final product:
Simply we would have a template which will be calling them "theme" files and bunch of tags to identify the content and location of information, and basically load 'em up into the RAM (1 line at a time) replace the tags with actual info and pass them to the user through a memoryStream.

Although it has a problem with folders,
It sees them as files not actual directories.
For exmaple: "e:+Radio+" links to "file:///E:/+Radio+"

Let me check the issue. Regarding the customization you may check the following method: https://github.com/unosquare/embedio/blob/master/src/Unosquare.Labs.EmbedIO/Modules/StaticFilesModule.cs#L288

Can you explain me your current file-system to reproduce the issue?

I have some suggestions to this feature to make it looks like nginx's autoindex:

  • Output entries in alphabetical order
  • Use <pre> for output links instead of <ul>
  • Add ../ at top for going back at hierarchy
  • Output "Last modified" time for entries and size for files

I can create pull request with this enhancements or path of them if you want

Sure, you can create a pull request with the suggestions. Thank you again.

You may find your changes in release 1.11.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

geoperez picture geoperez  路  8Comments

shdwp picture shdwp  路  6Comments

felixerdy picture felixerdy  路  7Comments

nkundu picture nkundu  路  7Comments

bufferUnderrun picture bufferUnderrun  路  4Comments