From: Ryan Sun on 1 Mar 2010 11:37 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?
From: Ashley Sheridan on 1 Mar 2010 12:00 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
From: Richard Quadling on 1 Mar 2010 12:10 On 1 March 2010 17:00, Ashley Sheridan <ash(a)ashleysheridan.co.uk> wrote: > 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 > > > If the authentication style is basic you COULD use the http://username:password(a)www.host.com/page.xxxxxx -- ----- Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling
|
Pages: 1 Prev: Custom php extension Next: session.entropy_file and hostname |