24 include_once(
'Services/FileSystem/classes/class.ilFileSystemStorage.php');
39 public function __construct($a_container_id = 0, $a_ass_id = 0)
41 $this->ass_id = $a_ass_id;
52 if ($this->ass_id > 0)
54 $this->submission_path = $this->path.
"/subm_".$this->ass_id;
55 $this->tmp_path = $this->path.
"/tmp_".$this->ass_id;
56 $this->feedb_path = $this->path.
"/feedb_".$this->ass_id;
57 $this->path.=
"/ass_".$this->ass_id;
95 return $this->submission_path;
103 return $this->tmp_path;
111 $path = $this->feedb_path.
"/".$a_user_id;
112 if(!file_exists(
$path))
128 if(!file_exists($this->submission_path))
132 if(!file_exists($this->tmp_path))
136 if(!file_exists($this->feedb_path))
149 if (!is_dir($this->path))
154 $dp = opendir($this->path);
155 while(
$file = readdir($dp))
157 if(!is_dir($this->path.
'/'.
$file))
161 'size' => filesize($this->path.
'/'.
$file),
163 'fullpath' => $this->path.
'/'.
$file);
183 function deliverFile($a_http_post_file, $user_id, $is_unziped =
false)
191 if(isset($a_http_post_file) && $a_http_post_file[
'size'])
203 $savepath .=
'/' .$user_id;
204 if(!is_dir($savepath))
210 if (!is_dir($savepath))
212 require_once
"./Services/Utilities/classes/class.ilUtil.php";
213 #ilUtil::makeDirParents($savepath);
217 $prefix = sprintf(
"%04d%02d%02d%02d%02d%02d", $now[
"year"], $now[
"mon"], $now[
"mday"], $now[
"hours"],
218 $now[
"minutes"], $now[
"seconds"]);
224 $savepath .
"/" . $prefix .
"_" .
$filename);
229 rename($a_http_post_file[
'tmp_name'],
230 $savepath .
"/" . $prefix .
"_" .
$filename);
233 require_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
235 if (is_file($savepath .
"/" . $prefix .
"_" .
$filename))
238 "filename" => $prefix .
"_" . $filename,
239 "fullname" => $savepath .
"/" . $prefix .
"_" . $filename,
258 while(
$file = readdir($dp))
260 if(!is_dir($this->path.
'/'.
$file) && substr(
$file, 0, 1) !=
".")
293 return $dir.
"/".$a_file;
302 if (is_array($a_files[
"name"]))
304 foreach ($a_files[
"name"] as $k => $name)
308 $type = $a_files[
"type"][$k];
309 $tmp_name = $a_files[
"tmp_name"][$k];
310 $size = $a_files[
"size"][$k];
313 $this->path.DIRECTORY_SEPARATOR.basename($name),