Custom CMS on PHP - issue with download (extra chars)

software development

#1

Hi

I have a issue with custom CMS on PHP/MySQL to download files from server.
It was working on previous hosting.
Root of issue - when I download stored file by link in browser - it is extra characters added: 5 characters (п»ї), and at the end, after EOF - html-header:

Files are stored correctly, and if I download by FTP - it is no extra symbols. I have added to end text of download.php, it is small and clear. I guess it is related to server settings for PHP. Could you help me about this - which settings should be corrected and how to do it? It was verified in different browsers - from IE to Chrome

Please help!

                Grigori
<?php //$type = ( isset( $_GET[ 'type' ] ) ) ? intval ( $type ) : 0; if (isset( $_GET[ 'type' ] )) {$type=$_GET[ 'type' ];}else{$type=0;} if ( $type == 0 ) { $dec = dbQuery( 'select * from `dec` where `id`=?i', Array( $_GET[ 'id' ] ), DB_FETCH_ROW_ASSOC ); if ( !is_array( $dec ) ) prn( 'File not found' ); header( 'content-type: '.$dec[ 'type' ] ); header( 'content-disposition: attachment; filename="'.$dec[ 'fname' ].'"' ); readfile( PATH_LIBS.'/dload/dec/'.$_GET[ 'id' ] ); } else { $dec = dbQuery( 'select * from `blank` where `id`=?i', Array( $_GET[ 'id' ] ), DB_FETCH_ROW_ASSOC ); if ( !is_array( $dec ) ) prn( 'File not found' ); header( 'content-type: '.$dec[ 'type' ] ); header( 'content-disposition: attachment; filename="'.$dec[ 'fname' ].'"' ); readfile( PATH_LIBS.'/dload/blank/'.$_GET[ 'id' ] ); } ?>