38 if (!$_FILES[
'attachmentFile'])
43 if ($_FILES[
'attachmentFile'][
"name"]==
"")
50 trace(
"Upload Base: {$config['uploadbase']}", 3);
51 trace(
"Upload Directory: {$config['uploaddir']}", 3);
54 $name = $_FILES[
'attachmentFile'][
"name"];
57 trace (
"Upload name _FILES attachmentFile name $name", 3);
58 trace (
"Upload attachment dir $dir", 3);
59 trace (
"Uploading file to $base/$file", 3);
61 if (!file_exists(
"$base/$dir"))
64 mkdir(
"{$config['uploadbase']}/$dir");
72 $file =
"$dir/{$attachment->attachment_id}$extension";
74 trace (
"Uploading file dir/attachment id extension: $file", 3);
76 if (file_exists(
"$base/$file"))
79 unlink(
"$base/$file");
82 move_uploaded_file($_FILES[
'attachmentFile'][
"tmp_name"],
"$base/$file");
83 chmod(
"$base/$file", 0755);
85 $size = getScaledSize(filesize(
"$base/$file"));
94 Fakoli::end(
"$attachment->attachment_id:$name:$icon:$size");
static using()
Import the datamodels, views and manifest for the specified component(s).
static end($message="")
Use this method to terminate execution of a script instead of using the php keywords exit() or die().