Thread: A question about the html&perl
Results 1 to 12 of 12
Serving up html using cgi-perl Forum: CGI Perl ForumReplies: 4
Perl/HTML issue Forum: CGI Perl ForumReplies: 0
How to email a HTML url in Perl Forum: CGI Perl ForumReplies: 0
How to post a variable from HTML to perl and from perl to HTML Forum: CGI Perl ForumReplies: 1
How to post a variable from HTML to perl and from perl to HTML Forum: Website Scripts ForumReplies: 0
02-25-2005, 12:35 PM #1
A question about the html&perl
I have a couple of questions about the file name and path on a web server. Thank you very much in advance.
1)Take http://www.google.com/mac as example, what is the html file name that is used to load this page? (apparently it is not mac/index.html)
2)How to save a image from web to local computer use perl, which function in what module can do it?
02-25-2005, 01:05 PM #2
1) It does not have to be an html extension, could be anything, just like this page is showthread.php
2) I do not follow the question, once the image is viewed on the web page it is automatically on the viewers computer.
02-25-2005, 01:26 PM #3
1) You mean the "mac" in that url is a file, not a path, right?
2)My question is how to use perl script to get the image file from remote web server, and save it on the hard disk of the local computer. (For example, use perl script to retrieve file http://www.google.com/sitesearch/mac.gif and save it on my pc)
Thanks in advance
02-25-2005, 02:09 PM #4
1) mac is a folder, we do not know what the default page is called or its extension. If you are trying to figure out a file path for a cgi script you should contact your host. Do not get a file path and a URL confused.
2) I cannot help you
02-25-2005, 06:32 PM #5
02-25-2005, 06:43 PM #6
You are in the right forum, just the wrong person trying to help
02-25-2005, 09:13 PM #7
http://www.google.com/mac/ It could be ANYTHING loaded in there. Its in complete control of the server owners.
In fact, if you factor in apache's mod_rewrite function, it could be a complete false server path altogether. http://www.google.com/mac could actually be loading http://www.google.com/made-up.dingle?dir=/mac you just can't tell without contacting the server owners.
As to the perl copy on local machine, it could be done as long as the Perl script is ON the local machine, and of course the Perl interpreter is also installed. If you meant a web-server installed CGI script to do this, then no, it can't.
02-28-2005, 12:21 PM #8
Thank you very much for your answer. I still didn't get the answer for my second question. What I want to know is which perl function (and/or in what module, the perl can be runed on the local computer and doesn't have to be a CGI) can be used to get the web image file (forexample: gif) to the local hard drive.(just like get(url) function in LWP module can get web page to the local computer).
Thanks again for your help.
02-28-2005, 12:23 PM #9
Ahha, if its a local perl script no worries, just use the Grab Extension
02-28-2005, 01:09 PM #10
Thank you very very much. That is very help, one more question, this Grab Extension can be used to get the image file. Are there any method avaliable in perl to get any binary file from internet?
02-28-2005, 01:21 PM #11
I dont know any off the top of my head, try having a look at www.hotscripts.com or www.cpan.org and useing the searches there.
02-28-2005, 02:30 PM #12
Thanks QuietDean, I got it. It is much simpler than I thought, just get the file from the internet, and save it in binmode. Thanks a lot, have great week.