24 include_once(
'Modules/Course/classes/class.ilFSStorageCourse.php');
59 $this->file_id = $a_file_id;
79 $new_file->setCourseId($a_target_id);
80 $new_file->setFileName($file_obj->getFileName());
81 $new_file->setFileSize($file_obj->getFileSize());
82 $new_file->setFileType($file_obj->getFileType());
83 $new_file->create(
false);
87 $source->copyFile($file_obj->getAbsolutePath(),$new_file->getAbsolutePath());
93 $this->file_id = $a_id;
106 $this->course_id = $a_course_id;
111 $this->file_name = $a_name;
115 return $this->file_name;
123 return $this->file_type;
127 $this->file_size = $a_size;
131 return $this->file_size;
135 $this->tmp_name = $a_name;
139 return $this->tmp_name;
143 $this->error_code = $a_code;
147 return $this->error_code;
152 if(is_object($this->fss_storage))
154 return $this->fss_storage->getInfoDirectory().
'/'.$this->
getFileId();
163 case UPLOAD_ERR_INI_SIZE:
164 $this->ilErr->appendMessage($this->lng->txt(
'file_upload_ini_size'));
166 case UPLOAD_ERR_FORM_SIZE:
167 $this->ilErr->appendMessage($this->lng->txt(
'file_upload_form_size'));
170 case UPLOAD_ERR_PARTIAL:
171 $this->ilErr->appendMessage($this->lng->txt(
'file_upload_only_partial'));
174 case UPLOAD_ERR_NO_TMP_DIR:
175 $this->ilErr->appendMessage($this->lng->txt(
'file_upload_no_tmp_dir'));
179 #case UPLOAD_ERR_CANT_WRITE: 180 # $this->ilErr->appendMessage($this->lng->txt('file_upload_no_write')); 184 case UPLOAD_ERR_NO_FILE:
199 $next_id = $ilDB->nextId(
'crs_file');
200 $query =
"INSERT INTO crs_file (file_id,course_id,file_name,file_size,file_type) ".
202 $ilDB->quote($next_id,
'integer').
", ".
212 $this->fss_storage->initInfoDirectory();
219 $this->fss_storage->getInfoDirectory().
'/'.$this->
getFileId());
230 $query =
"DELETE FROM crs_file ".
231 "WHERE file_id = ".$ilDB->quote($this->
getFileId(),
'integer').
"";
248 $query =
"DELETE FROM crs_file ".
249 "WHERE course_id = ".$ilDB->quote($a_course_id,
'integer').
"";
264 $query =
"SELECT * FROM crs_file ".
265 "WHERE course_id = ".$ilDB->quote($a_course_id,
'integer').
"";
268 while(
$row = $ilDB->fetchObject(
$res))
285 $query =
"SELECT * FROM crs_file WHERE file_id = ".$ilDB->quote($this->file_id,
'integer');
287 while(
$row = $ilDB->fetchObject(
$res))
setTemporaryName($a_name)
__construct($a_file_id=null)
Constructor.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static _readFilesByCourse($a_course_id)
Create styles array
The data for the language used.
setCourseId($a_course_id)
static _deleteByCourse($a_course_id)
static _cloneFiles($a_source_id, $a_target_id)
Clone course files.