| @@ 90-104 (lines=15) @@ | ||
| 87 | return $response; |
|
| 88 | } |
|
| 89 | $content = file_get_contents($tmpname); |
|
| 90 | if($view->file_put_contents('/imports/'.$filename, $content)) { |
|
| 91 | $progresskey = 'contacts-import-' . rand(); |
|
| 92 | $response->setParams( |
|
| 93 | array( |
|
| 94 | 'filename'=>$filename, |
|
| 95 | 'progresskey' => $progresskey, |
|
| 96 | 'backend' => $params['backend'], |
|
| 97 | 'addressBookId' => $params['addressBookId'], |
|
| 98 | 'importType' => $format |
|
| 99 | ) |
|
| 100 | ); |
|
| 101 | } else { |
|
| 102 | $response->bailOut(App::$l10n->t('Error uploading contacts to storage.')); |
|
| 103 | return $response; |
|
| 104 | } |
|
| 105 | } else { |
|
| 106 | $response->bailOut('Temporary file: \''.$tmpname.'\' has gone AWOL?'); |
|
| 107 | return $response; |
|
| @@ 130-143 (lines=14) @@ | ||
| 127 | } |
|
| 128 | ||
| 129 | $content = \OC\Files\Filesystem::file_get_contents($path . '/' . $filename); |
|
| 130 | if($view->file_put_contents('/imports/' . $filename, $content)) { |
|
| 131 | $progresskey = 'contacts-import-' . rand(); |
|
| 132 | $response->setParams( |
|
| 133 | array( |
|
| 134 | 'filename'=>$filename, |
|
| 135 | 'progresskey' => $progresskey, |
|
| 136 | 'backend' => $params['backend'], |
|
| 137 | 'addressBookId' => $params['addressBookId'], |
|
| 138 | 'importType' => $params['importType'] |
|
| 139 | ) |
|
| 140 | ); |
|
| 141 | } else { |
|
| 142 | $response->bailOut(App::$l10n->t('Error moving file to imports folder.')); |
|
| 143 | } |
|
| 144 | return $response; |
|
| 145 | } |
|
| 146 | ||