Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 570 Bytes

4-security.md

File metadata and controls

18 lines (13 loc) · 570 Bytes

Chapter 4 - Security

To prevent attackers from uploading and executing PHP scripts, you should add a .htaccess to enforce security restrictions.

Example:

 // .htaccess
 
 ForceType application/octet-stream
 Header set Content-Disposition attachment
 <FilesMatch "(?i)\.(gif|jpe?g|png)$">
     ForceType none
     Header unset Content-Disposition
 </FilesMatch>
 Header set X-Content-Type-Options nosniff

Source: https://github.com/blueimp/jQuery-File-Upload/wiki/Security