DelphiFAQ Home Search:

How can I download a file via http?


comments5 comments. Current rating: 3 stars (1 votes). Leave comments and/ or rate it.


How can I download a file via http?


You could make a system call to lynx and read the input. This puts a bit more load on your computer and should not be used if you are going to retrieve many documents.

You have more control and a more efficient solution using the LWP package (second part in the code below).

# invoking lynx

$html_code = `lynx -source`;
$text_data = `lynx -dump`;  

# using LWP

use LWP::Simple;
$content = get('');


2012-06-05, 21:34:38
anonymous from China  
<strong> http://www.coachout..strong> <a href=' http://www.coachout..g>Coach Outlet Online</strong></a><br />
<strong> http://www.coachfac..strong> <a href=' http://www.coachfac..g>Coach Factory</strong></a><br />
<strong> http://www.myloveco..strong> <a href=' http://www.myloveco..g>Coach Outlet Online</strong></a><br />
<strong> http://www.buyincoa..strong> <a href=' http://www.buyincoa..g>Coach Outlet</strong></a><br />
<strong> http://www.cheapcoa..strong> <a href=' http://www.cheapcoa..g>Cheap Coach Handbags</strong></a><br />
<strong> http://www.coachfac..strong> <a href=' http://www.coachfac..g>Coach Factory Outlet</strong></a><br />
<strong> http://www.buycoach..strong> <a href=' http://www.buycoach..g>Coach Outlet Online</strong></a><br />
<strong></strong> <a href=' http://www.coachout..g>Coach Factory Outlet</strong></a><br />
<strong></strong> <a href=' http://www.coachout..g>Coach Outlet Online</strong></a><br />
<strong></strong> <a href=' http://www.coachfac..g>Coach Factory</strong></a><br />
<strong></strong> <a href=' http://www.gotocoac..g>Coach Outlet Online</strong></a><br />
2012-10-22, 23:48:20
megaabstauberseo from Philippines  
I just read through the entire article of yours and it was quite good. This is a great article thanks for sharing this information
2012-11-12, 01:58:12
anonymous from United Kingdom  
2013-02-07, 04:43:20
chlmdm <a href=' '>payday loan</a> Cmzqv <a href=' '>payday loan</a> 8]]] <a href=' '>paydayuk</a> tMcmZW
2014-07-28, 09:33:01
anonymous from United States  
'To reduce your presidency to programmatic achievements is to ignore its soul,' he said He showed big-time stuff,' Weiss said We believe this is just a start (Human rights groups have argued to the contrary, saying failure to act makes one legally responsible as an accomplice'I'm proud of the selfless actions that my roommate, Jon Meis, showed today taking down the shooter,' fellow student Matt Garcia wrote on Twitter



NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: