diff --git a/vas/rest/ws/vitis/Vitis.class.inc b/vas/rest/ws/vitis/Vitis.class.inc
index 8a8bb421b700c0ed3043039ef9102172b187c55c..e6022e657d07e2071a5fc7ee471c24a7cfb23848 100644
--- a/vas/rest/ws/vitis/Vitis.class.inc
+++ b/vas/rest/ws/vitis/Vitis.class.inc
@@ -1,6 +1,7 @@
 <?php
 
 require_once(__DIR__ . "/../../class/vitis_lib/DbClass.class.inc");
+require_once ("aws_sdk/aws-autoloader.php");
 
 /**
  * \file vitis.class.inc
@@ -209,7 +210,7 @@ class Vitis extends DbClass {
      * @param $sVitisObjectName Name of the vitis object, if provide and the object contains files stored in ws_data/vitis/$sVitisObjectName the values will be url formed
      * @return the array of objects
      */
-    function genericGet($sSchema, $sTable, $sIdField, $bOnlyReturnStatus = false, $sVitisObjectName = "") {
+    function genericGet($sSchema, $sTable, $sIdField, $bOnlyReturnStatus = false, $sVitisObjectName = "", $sVitisModuleName = "vitis", $sVitisPathComplement = "documents") {
         if (!empty($this->aProperties['ws_data_alias']))
             $ws_data_alias = $this->aProperties['ws_data_alias'];
         else
@@ -249,15 +250,71 @@ class Vitis extends DbClass {
 
                     // Vérifie si il y a des fichiers à renvoyer
                     if ($sVitisObjectName != "") {
-                        $sDataDir = $this->aProperties['ws_data_dir'] . '/vitis/' . $sVitisObjectName . '/documents/' . $oObject->aFields[$sIdField];
-                        $sDataUrl = $this->aProperties['web_server_name'] . "/" . $ws_data_alias . "/vitis/" . $sVitisObjectName . "/documents/" . $oObject->aFields[$sIdField];
-                        if (is_dir($sDataDir)) {
-                            // Remplace le nom du fichier par son url
-                            foreach ($oObject->aFields as $key => $value) {
-                                if (is_dir($sDataDir . "/" . $key)) {
-                                    $oObject->aFields[$key] = $sDataUrl . "/" . $key . "/" . $value . "?d=" . $date->getTimestamp();
-                                }
+                        $sDataUrl = $this->aProperties['web_server_name'] . "/rest/vitis/file_downloader?key=[KEY]&eTag=[ETAG]&d=" . $date->getTimestamp();
+
+                        if($this->aProperties['fileS3Uploader']){
+                          // use HEAD on s3 Object
+                          // traitement du bucket et de ses sous-dossiers
+                          $sBucket = $this->aProperties['fileS3UploaderBucket'];
+                          $sPrefix = "";
+
+                          if (strpos($sBucket, "/") > -1){
+                              $aBucket = explode("/", $sBucket );
+                              $sBucket = $aBucket[0];
+                              $sPrefix = implode("/", array_slice($aBucket, 1));
+                          }
+                          // Création du client S3
+                          $s3 = new Aws\S3\S3Client(array(
+                              'version'=>'latest',
+                              'region'=> $this->aProperties['fileS3UploaderRegion'],
+                              'profile'=> $this->aProperties['fileS3UploaderProfil'],
+                              'debug' => false
+                          ));
+
+                          $sListPrefix = $sPrefix . "/ws_data/".$sVitisModuleName.'/' . $sVitisObjectName . '/';
+
+                          if (!empty($sVitisPathComplement)){
+                            $sListPrefix .= $sVitisPathComplement . '/';
+                          }
+
+                          $sListPrefix .= $oObject->aFields[$sIdField];
+
+                          try{
+                            $aList = $s3->listObjectsV2(array(
+                              'Bucket' => $sBucket,
+                              'Prefix' => $sListPrefix
+                            ));
+
+
+
+                            if ($aList["KeyCount"] > 0){
+                              foreach ($aList["Contents"] as $aObject){
+                                $aPath = explode("/", $aObject["Key"]);
+                                $sObjectField = $aPath[count($aPath) - 2];
+
+                                $sFileUrl = str_replace("[KEY]", $aObject["Key"], $sDataUrl);
+                                $oObject->aFields[$sObjectField] = str_replace("[ETAG]", str_replace('"', '', $aObject["ETag"]), $sFileUrl);
+                              }
                             }
+
+                          }catch(Aws\S3\Exception\S3Exception $e){
+                            writeToErrorLog($e->getMessage());
+                          }
+                        } else {
+                          // check dans ws_data
+                          $sDataDir = $this->aProperties['ws_data_dir'] . '/'.$sVitisModuleName.'/' . $sVitisObjectName . '/' . $sVitisPathComplement . '/' . $oObject->aFields[$sIdField];
+                          if (is_dir($sDataDir)) {
+                              // Remplace le nom du fichier par son url
+                              foreach ($oObject->aFields as $key => $value) {
+                                  if (is_dir($sDataDir . "/" . $key)) {
+                                      $sKey = "ws_data/".$sVitisModuleName.'/' . $sVitisObjectName . '/' . $sVitisPathComplement . '/' . $oObject->aFields[$sIdField]. "/" . $key . "/" . $value;
+                                      $sEtag = sha1(file_get_contents($sDataDir . "/" . $key . "/" . $value ), false);
+
+                                      $sFileUrl = str_replace("[KEY]", $sKey, $sDataUrl);
+                                      $oObject->aFields[$key] = str_replace("[ETAG]", $sEtag, $sFileUrl);
+                                  }
+                              }
+                          }
                         }
                     }
                     array_push($this->aObjects, $oObject);