Re: how to download files require login
| From: | Ashley Sheridan | Date: | Mon, 01 Mar 2010 17:00:32 +0000 |
| Subject: | Re: how to download files require login | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-302447@lists.php.net to get a copy of this message | ||
On Mon, 2010-03-01 at 11:37 -0500, Ryan Sun wrote:
> For URLs like
> 'http://download.fotolia.com/DownloadContent/1/h7G0bWGsGof8VvSqw32xFZ0KvD5eqbvN',
> it requires user login to download.
> Then how do I download it remotely via php server if I have the
> username and password in hand?
>
This is a job for Curl. You create a Curl request that sends the login
information to the remote site in the form that it expects (usually via
some sort of post data from a form) and then you can receive the reply
back. You can then form your requests that you need to make for the
rest.
There are some great add-ons for Firefox for this sort of thing, to look
at what data is being sent to and from your browser.
Thanks,
Ash
http://www.ashleysheridan.co.uk