source: sandbox/2.2.0.2/contactcenter/inc/cc_updown.php @ 4510

Revision 4510, 1023 bytes checked in by wmerlotto, 13 years ago (diff)

Ticket #1935 - Correcao na importacao de contatos de arquivos CSV do contactcenter

  • 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 ("Content-Type: application/octet-stream");
17                header ("Cache-Control: must-revalidate, post-check=0, pre-check=0");
18                header('Content-Length: ' . filesize($file_path));
19                header("Content-disposition: attachment; filename=".$file_name);
20                readfile($file_path);
21                unlink($file_path);
22        }
23?>
Note: See TracBrowser for help on using the repository browser.