public function uploadPhotoFromPath($eventId, $filepath, $albumId = null)
    {
        if (is_null($eventId) || $eventId == '') {
            throw new Exception('The eventId is required to upload a file.');
        }

        if (is_null($filepath) || $filepath == '') {
            throw new Exception('The filepath is required to upload a file.');
        }

        if (!file_exists($filepath)) {
            throw new Exception('The filepath does not point to an accessible file.');
        }

        $params = array(
            'method' => 'sp.photo.upload',
            'event_id' => $eventId,
            'album_id' => $albumId
        );

        $photos = array(
            'photo' => new CURLFile($filepath),
        );

        return $this->_makeApiRequest($params, $photos);
    }
public function uploadPhotoFromPath($eventId, $filepath, $albumId = null)
    {
        if (is_null($eventId) || $eventId == '') {
            throw new Exception('The eventId is required to upload a file.');
        }

        if (is_null($filepath) || $filepath == '') {
            throw new Exception('The filepath is required to upload a file.');
        }

        if (!file_exists($filepath)) {
            throw new Exception('The filepath does not point to an accessible file.');
        }

        $params = array(
            'method' => 'sp.photo.upload',
            'event_id' => $eventId,
            'album_id' => $albumId
        );

        $photos = array(
            'photo' => new CURLFile($filepath),
        );

        return $this->_makeApiRequest($params, $photos);
    }
public function uploadPhotoFromPath ( $ eventId , $ filepath , $ albumId = null ) { if ( is_null ( $ eventId ) || $ eventId == '' ) { throw new Exception ( 'The eventId is required to upload a file.' ) ; } if ( is_null ( $ filepath ) || $ filepath == '' ) { throw new Exception ( 'The filepath is required to upload a file.' ) ; } if ( ! file_exists ( $ filepath ) ) { throw new Exception ( 'The filepath does not point to an accessible file.' ) ; } $ params = array ( 'method' => 'sp.photo.upload' , 'event_id' => $ eventId , 'album_id' => $ albumId ) ; $ photos = array ( 'photo' => new CURLFile ( $ filepath ) , ) ; return $ this -> _makeApiRequest ( $ params , $ photos ) ; }
Method to upload a file from a filepath

@param integer $eventId
@param stirng $filepath
@param integer $albumId
@return array
Method to upload a file from a filepath