How to disable file upload permission and diretory indexing in apache Tomcat 8

Solution 1:

Tomcat does not enable file-uploads by default. If you wanted to allow file uploads, you'd have to enable WebDAV or build upload capabilities into your own application.

Directory indexes are disabled by default. If you wanted to allow directory listings, you'd need to edit your application's WEB-INF/web.xml file to define the default servlet and override the default setting for listings.

Tomcat doesn't have anything like Apache httpd's .htaccess files.

If you have a non-default configuration, perhaps you should post that and you might get a more specific answer.