CodeIgnitEE
upload_unable_to_write_file / expressionengine / codeigniter forum upload

If you get “upload_unable_to_write_file” or “The file could not be written to disk.” when uploading a PDF for instance in an ExpressionEngine forum it is because of this code in codeigniter/system/libraries/Upload.php:

        /*
         * Run the file through the XSS hacking filter
         * This helps prevent malicious code from being
         * embedded within a file.  Scripts can easily
         * be disguised as images or other file types.
         */
        if ($this->xss_clean)
        {
            if ($this->do_xss_clean() === FALSE)
            {
                $this->set_error('upload_unable_to_write_file');
                return FALSE;
            }
            
        }

Uncomment it to fix - of course, you risk XSS attacks in the process.