Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #12069 > unrolled thread
| Started by | zhangfj@gmail.com |
|---|---|
| First post | 2013-12-02 09:21 -0800 |
| Last post | 2013-12-03 08:50 -0500 |
| Articles | 15 — 7 participants |
Back to article view | Back to comp.lang.php
Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? zhangfj@gmail.com - 2013-12-02 09:21 -0800
Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? Jerry Stuckle <jstucklex@attglobal.net> - 2013-12-02 12:25 -0500
Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? zhangfj@gmail.com - 2013-12-02 18:23 -0800
Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? Denis McMahon <denismfmcmahon@gmail.com> - 2013-12-02 17:31 +0000
Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? zhangfj@gmail.com - 2013-12-02 19:10 -0800
Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? The Natural Philosopher <tnp@invalid.invalid> - 2013-12-03 10:09 +0000
Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? Jerry Stuckle <jstucklex@attglobal.net> - 2013-12-03 08:15 -0500
Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? zhangfj@gmail.com - 2013-12-03 18:26 -0800
Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? Jerry Stuckle <jstucklex@attglobal.net> - 2013-12-03 22:41 -0500
Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? richard <noreply@example.com> - 2013-12-02 13:19 -0500
Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? zhangfj@gmail.com - 2013-12-02 18:43 -0800
Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? richard <noreply@example.com> - 2013-12-03 08:41 -0500
Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? Evan Platt <evan@theobvious.espphotography.com.invalid> - 2013-12-02 22:15 -0800
Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? "J.O. Aho" <user@example.net> - 2013-12-03 07:57 +0100
Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? richard <noreply@example.com> - 2013-12-03 08:50 -0500
| From | zhangfj@gmail.com |
|---|---|
| Date | 2013-12-02 09:21 -0800 |
| Subject | Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? |
| Message-ID | <78ee20af-31d5-41a2-8494-5f6e5734af0a@googlegroups.com> |
Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? I mean not manually. I can download the file in these kind address, manually. There is a button in the web page, and the web url change to "http://***.com/down.php" once the button is clicked. I have no idea about download it through programming.(Thus they may be downloaded automatically.) Is that possible ? Any comment is appreciated. Thanks in advance.
[toc] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2013-12-02 12:25 -0500 |
| Message-ID | <l7ifpr$a57$1@dont-email.me> |
| In reply to | #12069 |
On 12/2/2013 12:21 PM, zhangfj@gmail.com wrote: > Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? > I mean not manually. > I can download the file in these kind address, manually. There is a button in the web page, and the web url change to "http://***.com/down.php" once the button is clicked. > > I have no idea about download it through programming.(Thus they may be downloaded automatically.) > Is that possible ? > > Any comment is appreciated. Thanks in advance. > You should be able to use cURL to download the file. Not having exact detail on what's happening, but I would suggest you use Firefox's Live HTTP Headers to see what's being sent to the server. That might give you some ideas. There's also a possibility the site uses javascript to download the file; this would be harder but you should still be able to determine what's being sent to the server to download the file. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | zhangfj@gmail.com |
|---|---|
| Date | 2013-12-02 18:23 -0800 |
| Message-ID | <d560fe0f-daf8-4af5-81de-1124dcc8a39e@googlegroups.com> |
| In reply to | #12070 |
在 2013年12月3日星期二UTC+8上午1时25分15秒,Jerry Stuckle写道: > On 12/2/2013 12:21 PM, zhangfj@gmail.com wrote: > > > Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? > > > I mean not manually. > > > I can download the file in these kind address, manually. There is a button in the web page, and the web url change to "http://***.com/down.php" once the button is clicked. > > > > > > I have no idea about download it through programming.(Thus they may be downloaded automatically.) > > > Is that possible ? > > > > > > Any comment is appreciated. Thanks in advance. > > > > > > > You should be able to use cURL to download the file. Not having exact > > detail on what's happening, but I would suggest you use Firefox's Live > > HTTP Headers to see what's being sent to the server. That might give > > you some ideas. > > > > There's also a possibility the site uses javascript to download the > > file; this would be harder but you should still be able to determine > > what's being sent to the server to download the file. > > > > -- > > ================== > > Remove the "x" from my email address > > Jerry Stuckle > > JDS Computer Training Corp. > > jstucklex@attglobal.net > > ================== Thank you. Your reply is the nearest to my objective. And thanks to other replies.
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Date | 2013-12-02 17:31 +0000 |
| Message-ID | <l7ig66$7ms$2@dont-email.me> |
| In reply to | #12069 |
On Mon, 02 Dec 2013 09:21:12 -0800, zhangfj wrote: > Can I download file with address like this > "http://***.com/file.php/ABC.html" automatically ? > I mean not manually. > I can download the file in these kind address, manually. There is a > button in the web page, and the web url change to > "http://***.com/down.php" once the button is clicked. > > I have no idea about download it through programming.(Thus they may be > downloaded automatically.) > Is that possible ? > > Any comment is appreciated. Thanks in advance. As you asked the question in a php newsgroup, I assume you wish to use php code to retrieve The term you need to google may be "php curl". However, as a simpler interface, if the php configuration allows it, you can also use a url as a filename to open a file. What you then do with the data you receive by reading from the file handle is up to you. This of course assumes that you know the url that you want to retrieve. If you're not using php to do the automatic download, you're asking in the wrong place. How "automatic" do you wish it to be? If you want it to happen every minute / hour / day / week etc you may wish to look up the scheduling mechanism on your system (usually cron on a linux/unix etc box, but I have no idea what you're actually using). -- Denis McMahon, denismfmcmahon@gmail.com
[toc] | [prev] | [next] | [standalone]
| From | zhangfj@gmail.com |
|---|---|
| Date | 2013-12-02 19:10 -0800 |
| Message-ID | <84647b61-3459-41ea-8c9e-85fbd1e145bc@googlegroups.com> |
| In reply to | #12071 |
Thank you for your informative reply. Briefly, my problem is that I can't download the file by programming. I want to change "ABC" in the URL to download files automatically from one site.
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-12-03 10:09 +0000 |
| Message-ID | <l7kakv$gov$1@news.albasani.net> |
| In reply to | #12081 |
On 03/12/13 03:10, zhangfj@gmail.com wrote:
> Thank you for your informative reply.
>
> Briefly, my problem is that I can't download the file by programming.
> I want to change "ABC" in the URL to download files automatically from one site.
>
You need to have a link top a PHP program that reads the file, then sets
up headers top tell the browser that it is not (to be understood to be)
an HTML: page, but a file download, and then sends the file.
so if your program was say -getfile.php and the file was 'rubbish.html'
<?php
header("Content-Disposition: attachment; filename=\"rubbish.html\"");
header("Content-Type: text/plain");
$data=file_get_contents("rubbish.html");
echo($data);
and that's it. No closing ?> should be used so there is no danger of
setting characters NOT in the file itself - the script exits still in
'php mode'
in your main page use
<a href="getfile.php">Download the file here</a>
Setting the content-disposition to 'attachment' strongly suggests to the
browser that the contents should not be displayed as HTML but should be
downloaded instead. However this behaviour is never 100% guaranteed.
instead of a local filename you can use a URL as well, if you are trying
to 'scrape' another website.
curl() will give you more control if you need it than
file_get_contents() for that.
http://us1.php.net/manual/en/curl.examples-basic.php
--
Ineptocracy
(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2013-12-03 08:15 -0500 |
| Message-ID | <l7klgm$gf8$1@dont-email.me> |
| In reply to | #12084 |
On 12/3/2013 5:09 AM, The Natural Philosopher wrote:
> On 03/12/13 03:10, zhangfj@gmail.com wrote:
>> Thank you for your informative reply.
>>
>> Briefly, my problem is that I can't download the file by programming.
>> I want to change "ABC" in the URL to download files automatically from
>> one site.
>>
>
> You need to have a link top a PHP program that reads the file, then sets
> up headers top tell the browser that it is not (to be understood to be)
> an HTML: page, but a file download, and then sends the file.
>
> so if your program was say -getfile.php and the file was 'rubbish.html'
>
> <?php
> header("Content-Disposition: attachment; filename=\"rubbish.html\"");
> header("Content-Type: text/plain");
> $data=file_get_contents("rubbish.html");
> echo($data);
>
> and that's it. No closing ?> should be used so there is no danger of
> setting characters NOT in the file itself - the script exits still in
> 'php mode'
>
> in your main page use
>
> <a href="getfile.php">Download the file here</a>
>
> Setting the content-disposition to 'attachment' strongly suggests to the
> browser that the contents should not be displayed as HTML but should be
> downloaded instead. However this behaviour is never 100% guaranteed.
>
> instead of a local filename you can use a URL as well, if you are trying
> to 'scrape' another website.
>
> curl() will give you more control if you need it than
> file_get_contents() for that.
>
> http://us1.php.net/manual/en/curl.examples-basic.php
>
>
Completely off the mark, as usual.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[toc] | [prev] | [next] | [standalone]
| From | zhangfj@gmail.com |
|---|---|
| Date | 2013-12-03 18:26 -0800 |
| Message-ID | <7d890e4b-f152-4e41-a8e5-649b9037087f@googlegroups.com> |
| In reply to | #12084 |
在 2013年12月3日星期二UTC+8下午6时09分34秒,The Natural Philosopher写道:
> On 03/12/13 03:10, zhangfj@gmail.com wrote:
>
> > Thank you for your informative reply.
>
> >
>
> > Briefly, my problem is that I can't download the file by programming.
>
> > I want to change "ABC" in the URL to download files automatically from one site.
>
> >
>
>
>
> You need to have a link top a PHP program that reads the file, then sets
>
> up headers top tell the browser that it is not (to be understood to be)
>
> an HTML: page, but a file download, and then sends the file.
>
>
>
> so if your program was say -getfile.php and the file was 'rubbish.html'
>
>
>
> <?php
>
> header("Content-Disposition: attachment; filename=\"rubbish.html\"");
>
> header("Content-Type: text/plain");
>
> $data=file_get_contents("rubbish.html");
>
> echo($data);
>
>
>
> and that's it. No closing ?> should be used so there is no danger of
>
> setting characters NOT in the file itself - the script exits still in
>
> 'php mode'
>
>
>
> in your main page use
>
>
>
> <a href="getfile.php">Download the file here</a>
>
>
>
> Setting the content-disposition to 'attachment' strongly suggests to the
>
> browser that the contents should not be displayed as HTML but should be
>
> downloaded instead. However this behaviour is never 100% guaranteed.
>
>
>
> instead of a local filename you can use a URL as well, if you are trying
>
> to 'scrape' another website.
>
>
>
> curl() will give you more control if you need it than
>
> file_get_contents() for that.
>
>
>
> http://us1.php.net/manual/en/curl.examples-basic.php
>
>
>
>
>
> --
>
> Ineptocracy
>
>
>
> (in-ep-toc’-ra-cy) – a system of government where the least capable to
>
> lead are elected by the least capable of producing, and where the
>
> members of society least likely to sustain themselves or succeed, are
>
> rewarded with goods and services paid for by the confiscated wealth of a
>
> diminishing number of producers.
Thanks for your information in detail, I can't understand them now. I will pay attention to that website to follow your idea.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2013-12-03 22:41 -0500 |
| Message-ID | <l7m88h$ro3$1@dont-email.me> |
| In reply to | #12116 |
On 12/3/2013 9:26 PM, zhangfj@gmail.com wrote:
> 在 2013年12月3日星期二UTC+8下午6时09分34秒,The Natural Philosopher写道:
>> On 03/12/13 03:10, zhangfj@gmail.com wrote:
>>
>>> Thank you for your informative reply.
>>
>>>
>>
>>> Briefly, my problem is that I can't download the file by programming.
>>
>>> I want to change "ABC" in the URL to download files automatically from one site.
>>
>>>
>>
>>
>>
>> You need to have a link top a PHP program that reads the file, then sets
>>
>> up headers top tell the browser that it is not (to be understood to be)
>>
>> an HTML: page, but a file download, and then sends the file.
>>
>>
>>
>> so if your program was say -getfile.php and the file was 'rubbish.html'
>>
>>
>>
>> <?php
>>
>> header("Content-Disposition: attachment; filename=\"rubbish.html\"");
>>
>> header("Content-Type: text/plain");
>>
>> $data=file_get_contents("rubbish.html");
>>
>> echo($data);
>>
>>
>>
>> and that's it. No closing ?> should be used so there is no danger of
>>
>> setting characters NOT in the file itself - the script exits still in
>>
>> 'php mode'
>>
>>
>>
>> in your main page use
>>
>>
>>
>> <a href="getfile.php">Download the file here</a>
>>
>>
>>
>> Setting the content-disposition to 'attachment' strongly suggests to the
>>
>> browser that the contents should not be displayed as HTML but should be
>>
>> downloaded instead. However this behaviour is never 100% guaranteed.
>>
>>
>>
>> instead of a local filename you can use a URL as well, if you are trying
>>
>> to 'scrape' another website.
>>
>>
>>
>> curl() will give you more control if you need it than
>>
>> file_get_contents() for that.
>>
>>
>>
>> http://us1.php.net/manual/en/curl.examples-basic.php
>>
>>
>>
>>
>>
>> --
>>
>> Ineptocracy
>>
>>
>>
>> (in-ep-toc’-ra-cy) – a system of government where the least capable to
>>
>> lead are elected by the least capable of producing, and where the
>>
>> members of society least likely to sustain themselves or succeed, are
>>
>> rewarded with goods and services paid for by the confiscated wealth of a
>>
>> diminishing number of producers.
>
> Thanks for your information in detail, I can't understand them now. I will pay attention to that website to follow your idea.
>
Don't waste your time. TNP didn't even understand your question, and
his response is way off target. But that's pretty normal for him.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[toc] | [prev] | [next] | [standalone]
| From | richard <noreply@example.com> |
|---|---|
| Date | 2013-12-02 13:19 -0500 |
| Message-ID | <1c5vek563h0ms$.oaf4g0x1huae.dlg@40tude.net> |
| In reply to | #12069 |
On Mon, 2 Dec 2013 09:21:12 -0800 (PST), zhangfj@gmail.com wrote: > Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? > I mean not manually. > I can download the file in these kind address, manually. There is a button in the web page, and the web url change to "http://***.com/down.php" once the button is clicked. > > I have no idea about download it through programming.(Thus they may be downloaded automatically.) > Is that possible ? > > Any comment is appreciated. Thanks in advance. Not really. As the convention of the URL does not allow wild cards. i.e. the ***. There are several programs available that download numerous pages from within a single domain. But not the way you want. However, it could possibly be done using a programmiing language called liberty basic. www.libertybasic.com They have a program where pages can be downloaded automatically. With a little extra coding, you could have it search through each and every domain until it finds a matching page and then download it. Then, if you get caught downloading copyrighted material you can tell us about your experiences from prison.
[toc] | [prev] | [next] | [standalone]
| From | zhangfj@gmail.com |
|---|---|
| Date | 2013-12-02 18:43 -0800 |
| Message-ID | <d6b41c56-2f3f-4bfd-847c-2a8b6c3b5ba5@googlegroups.com> |
| In reply to | #12072 |
在 2013年12月3日星期二UTC+8上午2时19分51秒,richard写道: > On Mon, 2 Dec 2013 09:21:12 -0800 (PST), zhangfj@gmail.com wrote: > > > > > Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? > > > I mean not manually. > > > I can download the file in these kind address, manually. There is a button in the web page, and the web url change to "http://***.com/down.php" once the button is clicked. > > > > > > I have no idea about download it through programming.(Thus they may be downloaded automatically.) > > > Is that possible ? > > > > > > Any comment is appreciated. Thanks in advance. > > > > Not really. > > As the convention of the URL does not allow wild cards. > > i.e. the ***. > > There are several programs available that download numerous pages from > > within a single domain. But not the way you want. > > > > However, it could possibly be done using a programmiing language called > > liberty basic. > > www.libertybasic.com > > They have a program where pages can be downloaded automatically. > > With a little extra coding, you could have it search through each and every > > domain until it finds a matching page and then download it. > > > > Then, if you get caught downloading copyrighted material you can tell us > > about your experiences from prison. LOL. My question maybe mislead you. I just wanna download materials from one site. And the changing part should be "ABC" in the url, in order to download automatically. Thanks for your reply.
[toc] | [prev] | [next] | [standalone]
| From | richard <noreply@example.com> |
|---|---|
| Date | 2013-12-03 08:41 -0500 |
| Message-ID | <1g45ooh19wsmh.zujhzn21pbvr$.dlg@40tude.net> |
| In reply to | #12080 |
On Mon, 2 Dec 2013 18:43:15 -0800 (PST), zhangfj@gmail.com wrote: > 在 2013年12月3日星期二UTC+8上午2时19分51秒,richard写道: >> On Mon, 2 Dec 2013 09:21:12 -0800 (PST), zhangfj@gmail.com wrote: >> >> >> >>> Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? >> >>> I mean not manually. >> >>> I can download the file in these kind address, manually. There is a button in the web page, and the web url change to "http://***.com/down.php" once the button is clicked. >> >>> >> >>> I have no idea about download it through programming.(Thus they may be downloaded automatically.) >> >>> Is that possible ? >> >>> >> >>> Any comment is appreciated. Thanks in advance. >> >> >> >> Not really. >> >> As the convention of the URL does not allow wild cards. >> >> i.e. the ***. >> >> There are several programs available that download numerous pages from >> >> within a single domain. But not the way you want. >> >> >> >> However, it could possibly be done using a programmiing language called >> >> liberty basic. >> >> www.libertybasic.com >> >> They have a program where pages can be downloaded automatically. >> >> With a little extra coding, you could have it search through each and every >> >> domain until it finds a matching page and then download it. >> >> >> >> Then, if you get caught downloading copyrighted material you can tell us >> >> about your experiences from prison. > > LOL. > > My question maybe mislead you. > I just wanna download materials from one site. And the changing part should be "ABC" in the url, in order to download automatically. > Thanks for your reply. There are programs out there that will do just that. Some will even download the entire site!
[toc] | [prev] | [next] | [standalone]
| From | Evan Platt <evan@theobvious.espphotography.com.invalid> |
|---|---|
| Date | 2013-12-02 22:15 -0800 |
| Message-ID | <gktq99hq70293hacf9l9s9ansn1r8n3ef3@4ax.com> |
| In reply to | #12072 |
On Mon, 2 Dec 2013 13:19:51 -0500, richard <noreply@example.com> wrote: >Not really. >As the convention of the URL does not allow wild cards. >i.e. the ***. You dumbass, the OP was simply munging the domain. Since you obviously don't understand the question, don't attempt to answer it. -- To reply via e-mail, remove The Obvious and .invalid from my e-mail address.
[toc] | [prev] | [next] | [standalone]
| From | "J.O. Aho" <user@example.net> |
|---|---|
| Date | 2013-12-03 07:57 +0100 |
| Subject | Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? |
| Message-ID | <bg5dm6F49f8U1@mid.individual.net> |
| In reply to | #12069 |
On 02/12/13 18:21, zhangfj@gmail.com wrote: > Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? > I mean not manually. > I can download the file in these kind address, manually. There is a button in the web page, and the web url change to "http://***.com/down.php" once the button is clicked. > > I have no idea about download it through programming.(Thus they may be downloaded automatically.) > Is that possible ? > > Any comment is appreciated. Thanks in advance. Not really a PHP question IMHO, read the man page for wget http://unixhelp.ed.ac.uk/CGI/man-cgi?wget It's a tool with which you can download a whole site, parts or what ever you like. -- //Aho
[toc] | [prev] | [next] | [standalone]
| From | richard <noreply@example.com> |
|---|---|
| Date | 2013-12-03 08:50 -0500 |
| Subject | Re: Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? |
| Message-ID | <7a3y1emgtd50.1vdqrihhfzoqp$.dlg@40tude.net> |
| In reply to | #12083 |
On Tue, 03 Dec 2013 07:57:10 +0100, J.O. Aho wrote: > On 02/12/13 18:21, zhangfj@gmail.com wrote: >> Can I download file with address like this "http://***.com/file.php/ABC.html" automatically ? >> I mean not manually. >> I can download the file in these kind address, manually. There is a button in the web page, and the web url change to "http://***.com/down.php" once the button is clicked. >> >> I have no idea about download it through programming.(Thus they may be downloaded automatically.) >> Is that possible ? >> >> Any comment is appreciated. Thanks in advance. > > Not really a PHP question IMHO, read the man page for wget > http://unixhelp.ed.ac.uk/CGI/man-cgi?wget > It's a tool with which you can download a whole site, parts or what ever > you like. Liberty Basic's urlmon.bas program can do that in a hearbeat. It pulls the entire page(s) as a single string and saves the file.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web