source: trunk/contactcenter/inc/cc_updown.php @ 5131

Revision 5131, 1.1 KB checked in by wmerlotto, 12 years ago (diff)

Ticket #2305 - Enviando alteracoes, desenvolvidas internamente na Prognus, do modulo 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(array_key_exists('import_file', $_FILES) && $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.