@@ -70,11 +70,11 @@ |
||
70 | 70 | if (!file_exists(DIR_FILE . 'Upload' . DS . $dir . DS)) { |
71 | 71 | mkdir(DIR_FILE . 'Upload' . DS . $dir . DS, 0777, true); |
72 | 72 | |
73 | - } // chmod('uploads/', 0755); |
|
73 | + } // chmod('uploads/', 0755); |
|
74 | 74 | else if (!file_exists(DIR_FILE . 'Upload' . DS . 'Default' . DS . $dir . DS)) { |
75 | 75 | mkdir(DIR_FILE . 'Upload' . DS . 'Default' . DS . $dir . DS, 0777, true); |
76 | 76 | |
77 | - } // chmod('uploads/', 0755); |
|
77 | + } // chmod('uploads/', 0755); |
|
78 | 78 | |
79 | 79 | if (move_uploaded_file($this->tmp, $this->path )) { |
80 | 80 | $output = '<div class="btn btn-success">'; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | */ |
18 | 18 | |
19 | 19 | |
20 | -class Uploads { |
|
20 | +class Uploads { |
|
21 | 21 | |
22 | 22 | |
23 | 23 | private $files; |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | |
68 | 68 | if (empty($errors)) { |
69 | 69 | |
70 | - if (!file_exists(DIR_FILE . 'Upload' . DS . $dir . DS)) { |
|
71 | - mkdir(DIR_FILE . 'Upload' . DS . $dir . DS, 0777, true); |
|
70 | + if (!file_exists(DIR_FILE . 'Upload' . DS . $dir . DS)) { |
|
71 | + mkdir(DIR_FILE . 'Upload' . DS . $dir . DS, 0777, true); |
|
72 | 72 | |
73 | 73 | } // chmod('uploads/', 0755); |
74 | 74 | else if (!file_exists(DIR_FILE . 'Upload' . DS . 'Default' . DS . $dir . DS)) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | } // chmod('uploads/', 0755); |
78 | 78 | |
79 | - if (move_uploaded_file($this->tmp, $this->path )) { |
|
79 | + if (move_uploaded_file($this->tmp, $this->path)) { |
|
80 | 80 | $output = '<div class="btn btn-success">'; |
81 | 81 | $output .= 'Ficheiro carregado com sucesso'; |
82 | 82 | $output .= '</div>'; |
@@ -54,8 +54,9 @@ |
||
54 | 54 | } else { |
55 | 55 | $allowed = array('jpg', 'JPG', 'jpeg', 'gif', 'btm', 'png', 'txt', 'docx', 'doc', 'pdf', 'mp3'); |
56 | 56 | |
57 | - if (in_array($ext, $allowed) === false) |
|
58 | - return $errors[] = '<div class="btn btn-danger">A extensao do ficheiro nao foi permitido </div>'; |
|
57 | + if (in_array($ext, $allowed) === false) { |
|
58 | + return $errors[] = '<div class="btn btn-danger">A extensao do ficheiro nao foi permitido </div>'; |
|
59 | + } |
|
59 | 60 | } |
60 | 61 | // 100000000 |
61 | 62 | $max_size = 100000000; |