Revision 4880,
1.0 KB
checked in by roberto.santosjunior, 13 years ago
(diff) |
Ticket #1820 - Erro ao exportar contatos no IE..........r4858
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
|
Line | |
---|
1 | <?php |
---|
2 | require_once '../../header.session.inc.php'; |
---|
3 | // This script upload an CSV file to import contacts .... |
---|
4 | if($ftmp = $_FILES['import_file']['tmp_name']){ |
---|
5 | // Foi necessário modificar o caminho onde se recuperava o diretório temporário. |
---|
6 | // Esse caminho foi hardcodificado na string abaixo ( /tmp ) temporariamente, mas deve ser recuperada atraves |
---|
7 | // da configuracao do Expresso. Ver ticket #385. |
---|
8 | $fname = "/tmp/contacts_".md5(microtime()).".swp"; |
---|
9 | if(move_uploaded_file($ftmp, $fname)) |
---|
10 | $_SESSION['contactcenter']['importCSV'] = $fname; |
---|
11 | } |
---|
12 | // ... or download an CSVfile to export contacts. |
---|
13 | else if($_GET['file_name']) { |
---|
14 | $file_name = $_GET['file_name']; |
---|
15 | $file_path = $_GET['file_path']; |
---|
16 | header("Pragma: public"); |
---|
17 | header ("Content-Type: application/octet-stream"); |
---|
18 | header ("Cache-Control: must-revalidate, post-check=0, pre-check=0"); |
---|
19 | header('Content-Length: ' . filesize($file_path)); |
---|
20 | header("Content-disposition: attachment; filename=".$file_name); |
---|
21 | readfile($file_path); |
---|
22 | unlink($file_path); |
---|
23 | } |
---|
24 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.