Re: [PHP] how to download files require login

[email protected] (Ashley Sheridan)
Newsgroups php.general
Message-ID <1267462832.2283.143.camel@localhost>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.