[Top-quoting fixed. Please don't do that. Type your reply *below* the
material you are quoting, after snipping signatures and other
irrelevant bits.]
Paul said:
Qing said:
I need to download lots of .gif files from a website by using perl. But
the following code doesn't work. Can anybody help?
There's a fairly obvious set of debugging steps one should take in this
situation. Can you please tell us what steps you've taken to debug
your problem, so that no one here is duplicating your effort?
Paul Lalli
[Code retained below for informational purposes]
use warnings;
use strict;
use POSIX 'strftime';
use LWP::Simple;
getstore('
http://websiteMainpageURL/picshow.asp?dir=Vocab7-9&page=pg1S.gif',
'pg1S.gif');
The file got downloaded, but not the right size, so the .gif file
couldn't be opened.
The correct file size should be 34kb, the downloaded (using perl)file
size is only 13kb.
So, the answer to my actual question - What steps have you taken to
debug your problem? - seems to be: "I tried the code, and saw that the
sizes are different. Then I posted to Usenet." Is that accurate?
Please TRY to debug your own problem!
* Capture the return value of the call to getstore()
* Check if it was a successful call
* Try going to the URL manually, and seeing if the file downloads
successfully in your own browser
* If the URL is to a server you have access to, check that server's
logs
Once you make an attempt at solving your own problem, and demonstrate
that you are putting effort into it, you will likely receive better
help from forums such as this one.
Also, please read (and follow) the Posting Guidelines for this group.
They are posted here twice a week.
Paul Lalli