gestion des chemins de fichier sans types

This commit is contained in:
Michael RICOIS 2010-03-30 09:58:01 +00:00
parent af369ce2d8
commit 5871af0979

View File

@ -1,30 +1,34 @@
<?php
$file = $_REQUEST['q'];
$type = $_REQUEST['type'];
switch($type){
case 'pdf':
$content_type = 'application/pdf';
$path = PATH_DATA.'/pdf/';
break;
case 'logos':
$explode = explode('.', $file);
switch($explode[1]){
case 'png': $content_type = 'image/png'; break;
case 'gif': $content_type = 'image/gif'; break;
case 'jpeg':
case 'jpg': $content_type = 'image/jpeg'; break;
}
$path = PATH_DATA.'/logos/';
break;
case 'conso':
$content_type = 'application/csv-tab-delimited-table';
$path = PATH_DATA.'/conso/';
break;
case 'surveillance':
$content_type = 'application/csv-tab-delimited-table';
$path = PATH_DATA.'/surveillance/';
break;
default: exit; break;
if(!empty($type)){
switch($type){
case 'pdf':
$content_type = 'application/pdf';
$path = PATH_DATA.'/pdf/';
break;
case 'logos':
$explode = explode('.', $file);
switch($explode[1]){
case 'png': $content_type = 'image/png'; break;
case 'gif': $content_type = 'image/gif'; break;
case 'jpeg':
case 'jpg': $content_type = 'image/jpeg'; break;
}
$path = PATH_DATA.'/logos/';
break;
case 'conso':
$content_type = 'application/csv-tab-delimited-table';
$path = PATH_DATA.'/conso/';
break;
case 'surveillance':
$content_type = 'application/csv-tab-delimited-table';
$path = PATH_DATA.'/surveillance/';
break;
default: exit; break;
}
}else{
$path = PATH_DATA.'/';
}
$firephp->log($path.$file, 'path');
if(file_exists($path.$file))