Dear All,
I'm searching a code which allow the user to download directly a file from the php web page. Has anyone knows how to do it? It seems to be a simple coding.
Regards
Dilbert137
Dear All,
I'm searching a code which allow the user to download directly a file from the php web page. Has anyone knows how to do it? It seems to be a simple coding.
Regards
Dilbert137
Do you mean like this?
<?php
echo '<xmp>'; //show pure html instead of styling
echo file_get_contents('http://www.daniweb.com/');
echo '</xmp>';
?>
Dear Sir,
I have tried your script but i'm getting errors.
[<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in
Regards
Dilbert137
That means the file does not exist. If you wish not to see the error an alternative would be curl.
Yes you are right i'm putting the domain name when i was doing test on my pc.
Thanks a lot
Dilbert137
prior threads
including access logging http://www.daniweb.com/forums/thread228637.html
http://www.daniweb.com/forums/thread213844.html
Thanks very much. It was exactly what i was searching for.
Thanks again
Dilbert137
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.