Why user cant download file?

My files stored in /files folder (/files and /system in my home folder)
when i try to download file to user via this:

class Files extends Controller
        function __construct()
        function index()
        function file($name="none")
            $fname = "/files/".$name;

            ($name!="none" && file_exists($fname))
                $data = file_get_contents($fname);

i get an error message that says
Message: file_get_contents(/files/price.doc) [function.file-get-contents]: failed to open stream: No such file or directory
but price.doc exists! (

use an absolute server path, not a web path.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.