Here are some file upload code tweaks.
1) add after line 411 log debug code:
from db/class_file.inc.php
switch ($_FILES[$upload_id]['error']) {
case UPLOAD_ERR_OK:
break;
case UPLOAD_ERR_INI_SIZE:
trigger_error("The uploaded file exceeds the upload_max_filesize directive (".ini_get("upload_max_filesize").") in php.ini.", E_USER_NOTICE);
break;
case UPLOAD_ERR_FORM_SIZE:
trigger_error("The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.", E_USER_NOTICE);
break;
case UPLOAD_ERR_PARTIAL:
trigger_error("The uploaded file was only partially uploaded.", E_USER_NOTICE);
break;
case UPLOAD_ERR_NO_FILE:
trigger_error("No file was uploaded.", E_USER_NOTICE);
break;
case UPLOAD_ERR_NO_TMP_DIR:
trigger_error("Missing a temporary folder.", E_USER_NOTICE);
break;
case UPLOAD_ERR_CANT_WRITE:
trigger_error("Failed to write file to disk", E_USER_NOTICE);
break;
default:
trigger_error("Unknown File Error", E_USER_NOTICE);
}
2) replace line 203 with code:
from pages/file.inc.php
echo '<input type="hidden" name="MAX_FILE_SIZE" value="'. confGet('FILE_UPLOAD_SIZE_MAX'). '" />';
echo '<input id="userfile" name="userfile" type="file" size="40" accept="*" />';
3) replace line 1313 with code:
from pages/proj.inc.php
echo '<input type="hidden" name="MAX_FILE_SIZE" value="'. confGet('FILE_UPLOAD_SIZE_MAX'). '" />';
echo '<input id="userfile" name="userfile" type="file" size="40" accept="*" />';
4) replace lines 386-374 with code:
from pagers/task_view.inc.php
$list->no_items_html= $list->summary=
"<div style='text-align:left;'>".__('attach new'). ":<br> "
. "<input type=hidden name='parent_task' value='$task->id'>"
.'<input type="hidden" name="MAX_FILE_SIZE" value="'. confGet('FILE_UPLOAD_SIZE_MAX'). '" />'
.'<input value="-" id="userfile" name="userfile" type="file" size="40" accept="*" />'
. '<input class=button type="button" value="' .__('Upload') ."" onclick='document.my_form.go.value="filesUpload";document.my_form.submit();'/>"
. '</div>'
;
Points 2-4 add hidden form field MAX_FILE_SIZE as stated in php documentation.