Skip to content
Snippets Groups Projects
Commit e137a924 authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

Fix: storeResourceFromURI problem with local copy to tmp, import to docserver...

Fix: storeResourceFromURI problem with local copy to tmp, import to docserver before copy is over: remove copy as fileURI provides link to original file.
parent 608e78db
No related branches found
No related tags found
No related merge requests found
...@@ -166,7 +166,7 @@ class resources_controler ...@@ -166,7 +166,7 @@ class resources_controler
$db = new dbquery(); $db = new dbquery();
$db->connect(); $db->connect();
//copy sended file on tmp //copy sended file on tmp
$fileContent = file_get_contents($fileURI); /*$fileContent = file_get_contents($fileURI);
$random = rand(); $random = rand();
$fileName = 'tmp_file_' . $random . '.' . $fileFormat; $fileName = 'tmp_file_' . $random . '.' . $fileFormat;
$Fnm = $_SESSION['config']['tmppath'] . $fileName; $Fnm = $_SESSION['config']['tmppath'] . $fileName;
...@@ -180,7 +180,15 @@ class resources_controler ...@@ -180,7 +180,15 @@ class resources_controler
'size' => filesize($Fnm), 'size' => filesize($Fnm),
'format' => $fileFormat, 'format' => $fileFormat,
'tmpFileName' => $fileName, 'tmpFileName' => $fileName,
);*/
$docserverControler = new docservers_controler();
$fileInfos = array(
'tmpDir' => dirname($fileURI) . DIRECTORY_SEPARATOR,
'size' => filesize($fileURI),
'format' => $fileFormat,
'tmpFileName' => basename($fileURI),
); );
//print_r($fileInfos); //print_r($fileInfos);
$storeResult = array(); $storeResult = array();
$storeResult = $docserverControler->storeResourceOnDocserver( $storeResult = $docserverControler->storeResourceOnDocserver(
...@@ -204,7 +212,7 @@ class resources_controler ...@@ -204,7 +212,7 @@ class resources_controler
$status, $status,
$fileFormat $fileFormat
); );
unlink($Fnm); //unlink($Fnm);
//var_dump($data);exit; //var_dump($data);exit;
$resId = $resource->load_into_db( $resId = $resource->load_into_db(
$table, $table,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment