Nitin Gupta wrote:

Hi All

In my application, I have a scenario in which user can upload various files. I am persisting these files on the File System itself. I need to make a http interface on these saved files.


Can I make use of Apache web server to serve these files from the file system over http protocol?


Yes. That's the basic function of a web server!

If yes, then please suggest a optimal configuration to make Apache a typical file server.

Rgds

n


The default configuration should work just fine.

In order to display directory listings (indexes) of the files, you'll want to /avoid/ using the DirectoryIndex directive (which tells Apache to display an HTML page such as index.html etc. instead of an an index).

Check out:
http://httpd.apache.org/docs/2.0/mod/core.html#options
http://httpd.apache.org/docs/2.0/mod/mod_autoindex.html
and http://httpd.apache.org/docs/2.0/mod/mod_dir.html

In its simplest configuration, Apache will display directory listings of the files at and below the web root and allow users to navigate the directories and download any file by right clicking on it.

Have fun!

John



Reply via email to