Directory should be created in the system before saving in the DB.

1.9.x
Julio Montoya 10 years ago
parent 6b9b7b5832
commit 448c456cca
  1. 12
      main/inc/lib/fileUpload.lib.php

@ -1518,12 +1518,14 @@ function create_unexisting_directory(
}
if (!is_dir($base_work_dir.$systemFolderName)) {
mkdir(
$result = mkdir(
$base_work_dir.$systemFolderName,
api_get_permissions_for_new_directories(),
true
);
if ($result) {
// Check if pathname already exists inside document table
$tbl_document = Database::get_course_table(TABLE_DOCUMENT);
$sql = "SELECT id, path FROM $tbl_document
@ -1584,15 +1586,15 @@ function create_unexisting_directory(
$session_id
);
}
$documentData = DocumentManager::get_document_data_by_id(
$document_id,
$_course['code'],
false,
$session_id
);
return $documentData;
} else {
return false;
}
} else {
$document = Database::fetch_array($rs);
@ -1608,11 +1610,11 @@ function create_unexisting_directory(
return $documentData;
}
} else {
}
}
return false;
}
}
/**
* Handles uploaded missing images

Loading…
Cancel
Save