Page 1 of 1

Attachment Upload Error on Windows starting in 2.4.0

Posted: Mon Sep 10, 2012 8:52 pm
by tonylacey
Script URL: Intranet
Version of script: 2.4.1
Hosting company: Internal
URL of phpinfo.php: internal
URL of session_test.php: internal
What terms did you try when SEARCHING for a solution: hesk attachment error file upload failed try smaller

Write your message below:

Hi,
Running on a Windows 2008 R2 Standard.
HESK version: 2.4.1 - HESK is up to date
PHP version: 5.3.6
MySQL version: 5.1.52-community
/hesk_settings.inc.php Exists, Writable
/attachments Exists, Writable

Getting an error when either Admin or outside users try to upload files...
"File upload failed, try with a smaller or no file attachment."
Version 2.3.9 worked fine. Just started happening with upgrade to 2.4.0. I tried increasing Max upload settings in php, I opened up all directories in hesk to everyone with full permissions. Still gave me this error.

Finally tracked it down to /inc/attachments.inc.php, these lines that were added in 2.4.0 I believe:

Code: Select all

    // Does the temporary file exist? If not, probably server-side configuration limits have been reached
    if ( ! file_exists($_FILES['attachment']['tmp_name'][$i]) )
    {
		return hesk_fileError($hesklang['fnuscphp']);
    }
I commented all this out and everything works again. If you need anything else from me please let me know and thank you very much for an excellent product!

Tony

Re: Attachment Upload Error on Windows starting in 2.4.0

Posted: Tue Sep 11, 2012 2:47 pm
by Klemen
Looks like your server either doesn't set $_FILES['attachment']['tmp_name'] paths correctly or doesn't allow PHP to check if the temporary file exists.

Thanks, will keep this in mind if anyone else has similar problems.