fs_download_image

The NextGEN Gallery fs download image function.

Description

fs_download_image( $from, $to ); 

Parameters (2)

0. $from
The from.
1. $to
The to.

Usage

  1. if ( !function_exists( 'fs_download_image' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextgen-gallery/freemius/includes/fs-core-functions.php'; 
  3.  
  4. // The from. 
  5. $from = null; 
  6.  
  7. // The to. 
  8. $to = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = fs_download_image($from, $to); 
  12.  

Defined (1)

The function is defined in the following location(s).

/freemius/includes/fs-core-functions.php  
  1. function fs_download_image( $from, $to ) { 
  2. $ch = curl_init( $from ); 
  3. $fp = fopen( fs_normalize_path( $to ), 'wb' ); 
  4. curl_setopt( $ch, CURLOPT_FILE, $fp ); 
  5. curl_setopt( $ch, CURLOPT_HEADER, 0 ); 
  6. curl_exec( $ch ); 
  7. curl_close( $ch ); 
  8. fclose( $fp );