Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
11 | public function uploadAttachment() |
||
12 | { |
||
13 | $item = $this->getModelFromRequest(); |
||
|
|||
14 | |||
15 | $file = $item->uploadFile($_FILES['Filedata']); |
||
16 | |||
17 | if ($file) { |
||
18 | $response['type'] = 'success'; |
||
19 | $response['url'] = $file->getURL(); |
||
20 | $response['name'] = $file->getName(); |
||
21 | $response['extension'] = $file->getExtension(); |
||
22 | $response['size'] = $file->formatSize(); |
||
23 | $response['time'] = date("d.m.Y H:i", $file->getTime()); |
||
24 | } else { |
||
25 | $response['type'] = 'error'; |
||
26 | } |
||
27 | $this->setResponseValues($response); |
||
28 | } |
||
46 |