What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [Solved]Download a file from an external server using PHP

[Solved]Download a file from an external server using PHP
Author: Message:
Mike
Elite Member
*****

Avatar
Meet the Spam Family!

Posts: 2795
Reputation: 48
32 / Male / Flag
Joined: Mar 2003
Status: Online
O.P. [Solved]Download a file from an external server using PHP
Hello..

I need to download an ASCII file from an external server to the server PHP is hosted, using PHP.

The reason I want to do this, is because I need to work with a file located in an external server.

I tried opening the file directly by passing the url as the file to open, but it said that allow_url_fopen is disabled.

I was suggested to use mod_socket to download the file, but it seems that mod_socket is disabled, because when I try to use socket_create; it says that I'm making a call to an undefined function...

So what can I do to download the file?

Thanks. :wavespam:

This post was edited on 07-07-2006 at 09:23 PM by Mike.
YouTube closed-captions ripper (also allows you to download videos!)
07-07-2006 08:39 PM
Profile E-Mail PM Web Find Quote Report
segosa
Community's Choice
*****


Posts: 1407
Reputation: 92
Joined: Feb 2003
RE: Download a file from an external server using PHP
code:
        function geturl($url)
        {
                $ch = curl_init();

                curl_setopt($ch, CURLOPT_URL, $url);
                curl_setopt($ch, CURLOPT_HEADER, 0);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER , 1);

                $out = curl_exec($ch);
                curl_close($ch);
                return $out;
        }

The previous sentence is false. The following sentence is true.
07-07-2006 09:19 PM
Profile PM Find Quote Report
Mike
Elite Member
*****

Avatar
Meet the Spam Family!

Posts: 2795
Reputation: 48
32 / Male / Flag
Joined: Mar 2003
Status: Online
O.P. RE: Download a file from an external server using PHP
Thanks segosa, working fine :)
YouTube closed-captions ripper (also allows you to download videos!)
07-07-2006 09:23 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On