CodeIgniter Forums
Download document error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Download document error (/showthread.php?tid=25626)



Download document error - El Forum - 12-18-2009

[eluser]Arivusudar[/eluser]
hi,

i have used for download document from my server system
i have used this coding for download

Code:
$this->load->helper('download');
$path = "http://192.168.1.20/sam_code/notes/admin_course.doc";
$data = file_get_contents($path); // Read the file's content
$name = "MyFileName";
force_downlo
ad($name, $data);

but am getting error like this

Code:
A PHP Error was encountered

Severity: Warning

Message: file_get_contents(http://192.168.1.20/sam_code/notes/admin_course.doc) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found

Filename: controllers/buynote.php

Line Number: 71

how can i solve this error?

my path is correct am sure that


Download document error - El Forum - 12-18-2009

[eluser]saidai jagan[/eluser]
use
Code:
$data = @file_get_contents($path); // Read the file's content