Index: plugins/importExport/_define.php
===================================================================
--- plugins/importExport/_define.php	(revision 840)
+++ plugins/importExport/_define.php	(revision 841)
@@ -16,5 +16,5 @@
 	/* Description*/		"Import and Export your blog",
 	/* Author */			"Olivier Meunier & Contributors",
-	/* Version */			'3.0',
+	/* Version */			'3.1',
 	/* Perm */			'admin'
 );
Index: plugins/importExport/inc/flat/class.flat.backup.php
===================================================================
--- plugins/importExport/inc/flat/class.flat.backup.php	(revision 840)
+++ plugins/importExport/inc/flat/class.flat.backup.php	(revision 841)
@@ -17,4 +17,5 @@
 	private $line_cols = array();
 	private $line_name;
+	private $line_num;
 	
 	private $replacement = array(
@@ -29,4 +30,5 @@
 		if (file_exists($file) && is_readable($file)) {
 			$this->fp = fopen($file,'rb');
+			$this->line_num = 1;
 		} else {
 			throw new Exception(__('No file to read.'));
@@ -43,9 +45,7 @@
 	public function getLine()
 	{
-		if (feof($this->fp)) {
+		if (($line = $this->nextLine()) === false) {
 			return false;
 		}
-		
-		$line = trim(fgets($this->fp));
 		
 		if (substr($line,0,1) == '[')
@@ -64,5 +64,5 @@
 			
 			if (count($this->line_cols) != count($line)) {
-				throw new Exception('Invalid row count');
+				throw new Exception(sprintf('Invalid row count at line %s',$this->line_num));
 			}
 			
@@ -74,5 +74,5 @@
 			}
 			
-			return new flatBackupItem($this->line_name,$res);
+			return new flatBackupItem($this->line_name,$res,$this->line_num);
 		}
 		else
@@ -81,4 +81,17 @@
 		}
 	}
+	
+	private function nextLine()
+	{
+		if (feof($this->fp)) {
+			return false;
+		}
+		$this->line_num++;
+		
+		$line = fgets($this->fp);
+		$line = trim($line);
+		
+		return empty($line) ? $this->nextLine() : $line;
+	}
 }
 
@@ -86,10 +99,12 @@
 {
 	public $__name;
+	public $__line;
 	private $__data = array();
 	
-	public function __construct($name,$data)
+	public function __construct($name,$data,$line)
 	{
 		$this->__name = $name;
 		$this->__data = $data;
+		$this->__line = $line;
 	}
 	
Index: plugins/importExport/inc/flat/class.flat.import.php
===================================================================
--- plugins/importExport/inc/flat/class.flat.import.php	(revision 840)
+++ plugins/importExport/inc/flat/class.flat.import.php	(revision 841)
@@ -630,5 +630,5 @@
 			$this->stack['post_id']++;
 		} else {
-			throw new Exception(__('The backup file does not appear to be well formed.'));
+			self::throwIdError($post->__name,$post->__line,'category');
 		}
 	}
@@ -640,5 +640,5 @@
 			$this->insertMeta($meta);
 		} else {
-			throw new Exception(__('The backup file does not appear to be well formed.'));
+			self::throwIdError($meta->__name,$meta->__line,'post');
 		}
 	}
@@ -666,6 +666,8 @@
 			
 			$this->insertPostMedia($post_media);
-		} else {
-			throw new Exception(__('The backup file does not appear to be well formed.'));
+		} elseif (!isset($this->old_ids['media'][(integer) $post_media->media_id])) {
+			self::throwIdError($post_media->__name,$post_media->__line,'media');
+		}else {
+			self::throwIdError($post_media->__name,$post_media->__line,'post');
 		}
 	}
@@ -678,5 +680,5 @@
 			$this->insertPing($ping);
 		} else {
-			throw new Exception(__('The backup file does not appear to be well formed.'));
+			self::throwIdError($ping->__name,$ping->__line,'post');
 		}
 	}
@@ -693,6 +695,16 @@
 			$this->stack['comment_id']++;
 		} else {
-			throw new Exception(__('The backup file does not appear to be well formed.'));
-		}
+			self::throwIdError($comment->__name,$comment->__line,'post');
+		}
+	}
+	
+	private static function throwIdError($name,$line,$related)
+	{
+		throw new Exception(sprintf(
+			__('ID of "%3$s" does not match on record "%1$s" at line %2$s of backup file.'),
+			html::escapeHTML($name),
+			html::escapeHTML($line),
+			html::escapeHTML($related)
+		));
 	}
 	
Index: plugins/importExport/locales/fr/main.po
===================================================================
--- plugins/importExport/locales/fr/main.po	(revision 840)
+++ plugins/importExport/locales/fr/main.po	(revision 841)
@@ -1,5 +1,5 @@
 # Language: Français
-# Module: importExport - 3.0
-# Date: 2012-07-09 12:33:59
+# Module: importExport - 3.1
+# Date: 2012-07-09 14:37:32
 # Translated with translater 1.5
 
@@ -7,7 +7,7 @@
 msgstr ""
 "Content-Type: text/plain; charset=UTF-8\n"
-"Project-Id-Version: importExport 3.0\n"
+"Project-Id-Version: importExport 3.1\n"
 "POT-Creation-Date: \n"
-"PO-Revision-Date: 2012-07-09T12:33:59+00:00\n"
+"PO-Revision-Date: 2012-07-09T14:37:32+00:00\n"
 "Last-Translator: Jean-Christian Denis\n"
 "Language-Team: \n"
@@ -308,5 +308,5 @@
 msgstr "Tables WordPress non trouvées"
 
-#: inc/flat/class.flat.backup.php:32
+#: inc/flat/class.flat.backup.php:34
 msgid "No file to read."
 msgstr "Aucun fichier lisible."
@@ -324,11 +324,7 @@
 msgstr "Le fichier n'est pas un fichier d'export complet."
 
-#: inc/flat/class.flat.import.php:632
-#: inc/flat/class.flat.import.php:642
-#: inc/flat/class.flat.import.php:669
-#: inc/flat/class.flat.import.php:680
-#: inc/flat/class.flat.import.php:695
-msgid "The backup file does not appear to be well formed."
-msgstr "Le fichier de sauvegarde ne semble pas être correctement formaté"
+#: inc/flat/class.flat.import.php:704
+msgid "ID of \"%3$s\" does not match on record \"%1$s\" at line %2$s of backup file."
+msgstr "L'ID de \"%3$s\" ne correspond pas dans l'enregistrement de \"%1$s\" à la ligne %2$s du fichier de sauvegarde."
 
 #: index.php:69
Index: plugins/importExport/script.js
===================================================================
--- plugins/importExport/script.js	(revision 0)
+++ 	(revision )
@@ -1,11 +1,0 @@
-$(function() {
-	if ($('*.error').length > 0) {
-		return;
-	}
-	
-	$('#ie-gui form[method=post]:has(input[type=hidden][name=autosubmit])').each(function() {
-		$('input[type=submit]',this).remove();
-		$(this).after('<p style="font-size:2em;text-align:center">' + dotclear.msg.please_wait + '</p>');
-		$(this).submit();
-	});
-});
