diff --git a/htdocs/document.php b/htdocs/document.php
index ddd039b0d4c3cbb0b74168f91a35b3d87a75f6d6..ca5fe49838243a8e51ce38f25ced819b76fa1c15 100644
--- a/htdocs/document.php
+++ b/htdocs/document.php
@@ -1,6 +1,6 @@
 <?php
 /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
- * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2004-2006 Laurent Destailleur  <eldy@users.sourceforge.net>
  * Copyright (C) 2005      Simon Tosser         <simon@kornog-computing.com>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -41,6 +41,7 @@ $modulepart = urldecode($_GET["modulepart"]);
 // D�fini type et attachment
 $type = urldecode($_GET["type"]); $attachment = true;
 if (eregi('\.html',$original_file)) { $type='text/html'; $attachment = false; }
+if (eregi('\.csv',$original_file))  { $type='text/csv'; $attachment = true; }
 if (eregi('\.pdf',$original_file))  { $type='application/pdf'; $attachment = true; }
 
 //Suppression de la chaine de caract�re ../ dans $original_file
@@ -151,7 +152,7 @@ if ($modulepart)
     }
 
 
-    // Wrapping pour la telephonie
+    // Wrapping pour les actions
     if ($modulepart == 'actionscomm')
     {
         $user->getrights('commercial');
@@ -173,7 +174,7 @@ if ($modulepart)
         $original_file=$conf->produit->dir_output.'/'.$original_file;
     }
 
-    // Wrapping pour les factures
+    // Wrapping pour les dons
     if ($modulepart == 'don')
     {
         $user->getrights('don');
@@ -184,6 +185,15 @@ if ($modulepart)
         $original_file=$conf->don->dir_output.'/'.$original_file;
     }
 
+    // Wrapping pour les exports
+    if ($modulepart == 'export')
+    {
+        // Aucun test necessaire car on force le rep de doanwload sur
+        // le rep export qui est propre � l'utilisateur
+        $accessallowed=1;
+        $original_file=$conf->export->dir_ouput.'/'.$user->id.'/'.$original_file;
+    }
+
 }
 
 // Limite acc�s si droits non corrects
diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php
index 09a5cf7b58dbfb24d1fe8e26c16372fe7b6bd5ce..cf8924c24968b4a5f0b939cb148548d61f3ea756 100644
--- a/htdocs/exports/export.php
+++ b/htdocs/exports/export.php
@@ -466,8 +466,7 @@ if ($step == 4 && $datatoexport)
 
     // Affiche liste des documents
     // NB: La fonction show_documents rescanne les modules qd genallowed=1
-    $filename=$datatoexport;
-    $htmlform->show_documents('export',$filename,$conf->export->dir_ouput.'/'.$user->id,$_SERVER["PHP_SELF"].'?step=4&amp;datatoexport='.$datatoexport,$liste,1,'csv');
+    $htmlform->show_documents('export','',$conf->export->dir_ouput.'/'.$user->id,$_SERVER["PHP_SELF"].'?step=4&amp;datatoexport='.$datatoexport,$liste,1,'csv');
     
     print '</td><td width="50%">&nbsp;</td></tr>';
     print '</table>';
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index 567253c76719b0a8594483ab5ae732b817c7e96a..6c6786551222c2e9214f40e901297b16c5206a31 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -1888,8 +1888,9 @@ class Form
 
 		        // D�fini chemin relatif par rapport au module pour lien download
 		        $relativepath=$filename."/".$file;
-                if ($modulepart == 'expedition') { $relativepath = get_exdir("${filename}")."${file}"; }
-                if ($modulepart == 'don')        { $relativepath = get_exdir("${filename}")."${file}"; }
+                if ($modulepart == 'expedition') { $relativepath = get_exdir($filename).$file; }
+                if ($modulepart == 'don')        { $relativepath = get_exdir($filename).$file; }
+                if ($modulepart == 'export')     { $relativepath = $file; }
 
                 // D�fini le type MIME du document
                 if (eregi('\.([^\.]+)$',$file,$reg)) $extension=$reg[1];