Error 406?
So you received an error 406 while trying to upload a file and you have no idea to fix it!
This usually happens when mod_security on your Apache server flags the upload as suspicious and blocks it. I ran into this on shared hosting when uploading files through a custom PHP form — everything worked locally but failed on the server.
The fix is to disable mod_security for your site using an .htaccess file. Note that this turns off the security module entirely for your domain, so only do this if you trust the input coming through. If you need more granular control, you can whitelist specific rules instead of disabling the whole module.
Create an .htaccess file in the root of your local website and add the following into it:
More on programming if that’s useful.
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>