Forum Moderators: coopster

Message Too Old, No Replies

How to download file from a different server

I suppose CURL is up for a job

         

genem

9:34 am on Jan 19, 2007 (gmt 0)

10+ Year Member



Hi,
At work, I'm not allowed to download media files. I'm thinking of making a script on my hosting account that would download and rename the file for me, which i can then safely download.

How do I go about this? From my knowledge, I need to CURL, right? One other thing: my host's max_execution_time setting is only 30 sec.

Thanks for your ideas.

ahmedtheking

5:00 pm on Jan 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yeah curl'll do it:

curl -O [yoursite.tld...]

mcavic

5:33 pm on Jan 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From the command line, curl or wget, and they aren't associated with PHP, so there's no max execution time.

From PHP, libcurl is powerful, and you might be able to use set_time_limit() to override your host's default.

genem

4:40 pm on Jan 22, 2007 (gmt 0)

10+ Year Member



Thanks, guys:-).
I a unix newb. How can I use curl in command line?

I'd like to clarify: When libcurl envokes curl, does it envoke it an independent curl unix process or does it run under php (i.e. constrained by the max_execution_time limit, for example)?

ahmedtheking

6:59 pm on Jan 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



curl -O [yoursite.tld...]

genem

9:42 pm on Jan 22, 2007 (gmt 0)

10+ Year Member



Thanks, Ahmed, it worked!