Revision 1679,
784 bytes
checked in by niltonneto, 15 years ago
(diff) |
Ticket #688 - Corrigido problema relacionado à importação de contatos por aquivo CSV.
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[2] | 1 | <?php |
---|
[1679] | 2 | require_once '../../header.session.inc.php'; |
---|
[2] | 3 | // This script upload an CSV file to import contacts .... |
---|
| 4 | if($ftmp = $_FILES['import_file']['tmp_name']){ |
---|
| 5 | $fname = ini_get("session.save_path").'/'."contacts_".md5(microtime()).".swp"; |
---|
| 6 | if(move_uploaded_file($ftmp, $fname)) |
---|
| 7 | $_SESSION['contactcenter']['importCSV'] = $fname; |
---|
| 8 | } |
---|
| 9 | // ... or download an CSV file to export contacts. |
---|
| 10 | else if($_GET['file_name']) { |
---|
| 11 | $file_name = $_GET['file_name']; |
---|
| 12 | $file_path = $_GET['file_path']; |
---|
| 13 | header ("Content-Type: application/octet-stream"); |
---|
| 14 | header ("Cache-Control: must-revalidate, post-check=0, pre-check=0"); |
---|
| 15 | header('Content-Length: ' . filesize($file_path)); |
---|
| 16 | header("Content-disposition: attachment; filename=".$file_name); |
---|
| 17 | readfile($file_path); |
---|
| 18 | } |
---|
| 19 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.