first i was getting a error:
that table wp_users.user_level doesn`t exist.
i setted up the table: user_level int 1
$SQL = "SELECT ".$table_prefix."attached_files_meta.file_id, ".$table_prefix."users.ID as user_id, ".$table_prefix."users.user_level as user_level FROM ".$table_prefix."users, ".$table_prefix."attached_files_meta, ".$table_prefix."posts WHERE ".$table_prefix."attached_files_meta.post_id = ".$table_prefix."posts.ID AND ".$table_prefix."posts.post_author = ".$table_prefix."users.ID AND ".$table_prefix."attached_files_meta.file_id = $file_id;";
the error is now gone.
next i went to write new page/article
i selected my files, and posted.
bug: each file is uploaded & displayed twice.
i tried this uploading only one file and more than one. the same error.