protected function _buildBinaryBody($input)
  {
    if (// is it a file, a readable one?
      @file_exists($input)
      && @is_readable($input)
    ) {
      // try to read the file
      $data = @file_get_contents($input);
      if ($data !== false && strlen($data) !== 0) {
        return $data;
      }
    } elseif (// is it a remote file?
      filter_var($input, FILTER_VALIDATE_URL)
      && preg_match('/^https?:\/\//', $input)
    ) {
      $data = $this->_fetchRemoteFile($input);
      if ($data !== false) {
        return $data;
      }
    }
    return $input;
  }
protected function _buildBinaryBody($input)
  {
    if (// is it a file, a readable one?
      @file_exists($input)
      && @is_readable($input)
    ) {
      // try to read the file
      $data = @file_get_contents($input);
      if ($data !== false && strlen($data) !== 0) {
        return $data;
      }
    } elseif (// is it a remote file?
      filter_var($input, FILTER_VALIDATE_URL)
      && preg_match('/^https?:\/\//', $input)
    ) {
      $data = $this->_fetchRemoteFile($input);
      if ($data !== false) {
        return $data;
      }
    }
    return $input;
  }
protected function _buildBinaryBody ( $ input ) { if ( // is it a file, a readable one? @ file_exists ( $ input ) && @ is_readable ( $ input ) ) { // try to read the file $ data = @ file_get_contents ( $ input ) ; if ( $ data !== false && strlen ( $ data ) !== 0 ) { return $ data ; } } elseif ( // is it a remote file? filter_var ( $ input , FILTER_VALIDATE_URL ) && preg_match ( '/^https?:\/\//' , $ input ) ) { $ data = $ this -> _fetchRemoteFile ( $ input ) ; if ( $ data !== false ) { return $ data ; } } return $ input ; }
Detect filenames in upload parameters

@param mixed $input The data or file name to parse

@return null|string
Detect filenames in upload parameters