Results 1 to 4 of 4

Thread: Download file using curl

  1. #1
    Join Date
    Sep 2003
    Posts
    3,040

    Default Download file using curl

    Here is a php function to download files from remote server using curl.

    $remote is url of source file.
    $local is path where you need the file saved after download.


    PHP Code:
    function curl_download($remote$local)    {
        
    $cp curl_init($remote);
        
    $fp fopen($local"w");
        
        
    curl_setopt($cpCURLOPT_FILE$fp);
        
    curl_setopt($cpCURLOPT_HEADER0);
        
        
    curl_exec($cp);
        
    curl_close($cp);
        
    fclose($fp);    


    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  2. #2
    Join Date
    Jun 2008
    Posts
    342

    Default PDF_open_file

    PDF_open_file

    (PHP 4 >= 4.0.5, PECL pdflib:1.0-2.1.3)
    PDF_open_file — Create PDF file [deprecated]

    Description.

    bool PDF_open_file ( resource $p , string $filename )


    Creates a new PDF file using the supplied file name. Returns TRUE on success or FALSE on failure.
    This function is deprecated since PDFlib version 6, use PDF_begin_document() instead.

  3. #3
    Join Date
    Jan 2006
    Location
    Press F13 to find the location
    Posts
    615

    Default

    A nice information. Will add this in my wallet. I used to hunt for a third part application to avail this function. :D

  4. #4
    Join Date
    Sep 2008
    Posts
    5

    Default

    It would be great if you an explanation about fopen function.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •