I updated some of my blogs to wordpress 2.9 and when i was trying to upload any pictures. I tried different solutions, including the one with the .htaccess and SecFilterEngine and nothing. While replacing stuff in .htaccess i noticed i had the php_flag display_errors set to off. I turned on and the error I got was this:

Call to undefined function ctype_digit() in /wp-admin/includes/file.php

After more digging, I came up with a solution of my own. Here it is. In file.php replace this line:

if ( isset( $file[‘error’] ) && !ctype_digit( $file[‘error’] ) && $file[‘error’] )

with this one:

if ( isset( $file[‘error’] ) && !is_numeric( $file[‘error’] ) && $file[‘error’] )

It worked!