GetValueByName('aname','audio', $_GET['id']); $Views = $PIC->ViewOneFiles('audio', $_GET['id']); if ($_GET['no_iconv'] != 1){ $PAGENAME = iconv('windows-1251', 'utf-8', $PAGENAME); } if ($Views["path"]!=''){ $punct_pos = mb_strrpos($Views['path'], "."); $extension = mb_substr($Views['path'], $punct_pos); $filename = !stripos($PAGENAME, 'mp3')?$PAGENAME.$extension:$PAGENAME; header('Content-type: application/mp3'); header('Content-Disposition: attachment; filename="'.$filename.'"'); readfile(DOC_ROOT.'/budhae/scripts/fancyupload/uploads/'.$Views['path']); }else { $punct_pos = mb_strrpos($Views['n3'], "."); $extension = mb_substr($Views['n3'], $punct_pos); $filename = !stripos($PAGENAME, 'mp3')?$PAGENAME.$extension:$PAGENAME; header('Content-type: application/mp3'); header('Content-Disposition: attachment; filename="'.$filename.'"'); readfile(DOC_ROOT.'/source/pimages/'.$Views['n3']); } /* $location = "Location: ".$_SERVER[HTTP_REFERER]; header($location);*/ ?>