--- org/proj_doc_update.php	2011-04-16 09:57:08.000000000 +0200
+++ new/proj_doc_update.php	2011-04-16 09:56:10.000000000 +0200
@@ -67,6 +67,8 @@
 
 		# grab the original file path and name
 		$t_disk_file_name = file_get_field( $f_file_id, 'diskfile', 'project' );
+		if ( strpos( $t_disk_file_name, '/' ) === false )
+			$t_disk_file_name = file_get_field( $f_file_id, 'folder', 'project' ) . $t_disk_file_name;
 		$t_file_path = dirname( $t_disk_file_name );
 
 		# prepare variables for insertion
@@ -74,9 +76,9 @@
 		$c_file_type = db_prepare_string( $v_type );
 		$t_file_size = filesize( $v_tmp_name );
 		$t_max_file_size = (int)min( ini_get_number( 'upload_max_filesize' ), ini_get_number( 'post_max_size' ), config_get( 'max_file_size' ) );
-        if ( $t_file_size > $t_max_file_size ) {
-            trigger_error( ERROR_FILE_TOO_BIG, ERROR );
-        }
+		if ( $t_file_size > $t_max_file_size ) {
+			trigger_error( ERROR_FILE_TOO_BIG, ERROR );
+		}
 		$c_file_size = db_prepare_int( $t_file_size );
 
 		$t_method = config_get( 'file_upload_method' );
