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.

Question:

How can I download a file via http?

Answer:

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 http://www.yahoo.com/`;
$text_data = `lynx -dump http://www.yahoo.com/`;  

# using LWP

use LWP::Simple;
$content = get('http://www.yahoo.com');

Comments:

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>www.coachoutletonfactory.net</strong> <a href=' http://www.coachout..g>Coach Factory Outlet</strong></a><br />
<strong>www.coachoutletonline4you.us</strong> <a href=' http://www.coachout..g>Coach Outlet Online</strong></a><br />
<strong>coachfactoryoutletq.net</strong> <a href=' http://www.coachfac..g>Coach Factory</strong></a><br />
<strong>gotocoachoutlets.net</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 http://www.megaabst..berseo.com
2012-11-12, 01:58:12
anonymous from United Kingdom  
2013-02-07, 04:43:20
 
rating
chlmdm <a href=' http://paydayloansvbc.com/ '>payday loan</a> Cmzqv <a href=' http://paydayloansvbc.ca/ '>payday loan</a> 8]]] <a href=' http://paydayloansvbc.co.uk/ '>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 http://vivermurca.com 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 http://www.weallaskwhy.com 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: