Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't save a remote file back to a local server

Status
Not open for further replies.

rubis

Programmer
Jun 21, 2001
54
GB
I want to save a HTML file from a Web site. I've 2 questions about it

1. I use LWP::Simple as below

$url = "$file = "/path/test.html";

$response = getstore($url, $file);

I have already changed mode of path to 777 (this path is outside my web directory) but test.html isn't saved back at all. I don't know what's wrong or anything about the permission problem??

2. if that web page is a frame (2 parts inside), which file will be saved back. HTML of the frame or all HTML files ??

Thanks
 
Well, about the 1st question, i never used the getstore function, but if you're doing the $response=getstore() the page will be assigned to $response. Try doing it without the variable. If that doesnt work, just use $response=get($url); and then save it to a file.

Second answer, it will only gets the html file which sets the frame. If you need all pages, you need to parse the html to get the frame url's, and perform a get() on those as well.

wzrd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top