Block navigation between folders when viewing a file uploaded to the Server

0

Good morning community,

Well my question is that I have a small problem when viewing a PDF file that I uploaded to the server through PHP, because, if I say I have this URL:

  • repository / Uploads / Files / archive.pdf

And if I try to navigate through the folders, let's say:

  • repository / Uploads / Files

I have access to all files that other users have uploaded and because for security reasons it is not viable for a user to do the above.

  

It should be noted that if you navigate to the folder " repository " there is no problem because it is redirected to the main page of my project.

This way I have my form to be able to visualize the file:

<tr ng-repeat="rutDatos in tableDatosRut track by rutDatos.ruta_pdf">
   <td>
       <a class="btn btn-info btn-sm  glyphicon glyphicon-eye-open"
                          ng-href="Uploads/Files/{{rutDatos.ruta_pdf}}">
       </a>
   </td>

I hope I have been as clear as possible, I do not know if it is the most viable way to visualize the file with that Angular directive, thanks for taking the time.

    
asked by jecorrales 08.08.2017 в 16:49
source

1 answer

1

Edit /etc/apache2/apache2.conf and look for the following section:

<Directory /var/www/>
        Options Indexes FollowSymLinks        
        AllowOverride None
        Require all granted
</Directory>

And change the Options line to:

   Options -Indexes

Then restart the service:

 sudo service apache2 restart
    
answered by 08.08.2017 / 19:18
source