BUG 9897 I add validation

I add validation to function uploadDoc in alfresco functions
This commit is contained in:
Brayan Osmar Pereyra Suxo
2012-10-08 14:26:34 -04:00
parent 392c4d86ae
commit b164d771ec

View File

@@ -282,6 +282,12 @@ function getFolderChildren($alfrescoServerUrl, $folderId, $user, $pwd) {
*
*/
function uploadDoc($alfrescoServerUrl, $fileSource, $title, $description, $docType, $user, $pwd, $path = '') {
if (!(file_exists($fileSource)))
{
G::SendTemporalMessage('ID_FILE_PLUGIN_NOT_EXISTS', 'error', 'labels', null, null, array('pluginFile' => $fileSource));
G::header('Location: '.$_SERVER['HTTP_REFERER']);
die;
}
$filep = fopen($fileSource,"r");
$fileLength = filesize($fileSource);
$fileContent = fread($filep,$fileLength);