filestack/mixins/CommonMixin.php
protected function sendGetMetaData($url, $fields = [], $security = null)
    {
        $url .= "/metadata?";
        foreach ($fields as $field_name) {
            $url .= "&$field_name=true";
        }

        // sign url if security is passed in
        if ($security) {
            $url = $security->signUrl($url);
        }

        $response = $this->sendRequest('GET', $url);
        $status_code = $response->getStatusCode();

        if ($status_code !== 200) {
            throw new FilestackException($response->getBody(), $status_code);
        }

        $json_response = json_decode($response->getBody(), true);

        return $json_response;
    }
protected function sendGetMetaData($url, $fields = [], $security = null)
    {
        $url .= "/metadata?";
        foreach ($fields as $field_name) {
            $url .= "&$field_name=true";
        }

        // sign url if security is passed in
        if ($security) {
            $url = $security->signUrl($url);
        }

        $response = $this->sendRequest('GET', $url);
        $status_code = $response->getStatusCode();

        if ($status_code !== 200) {
            throw new FilestackException($response->getBody(), $status_code);
        }

        $json_response = json_decode($response->getBody(), true);

        return $json_response;
    }
protected function sendGetMetaData ( $ url , $ fields = [ ] , $ security = null ) { $ url .= "/metadata?" ; foreach ( $ fields as $ field_name ) { $ url .= "&$field_name=true" ; } // sign url if security is passed in if ( $ security ) { $ url = $ security -> signUrl ( $ url ) ; } $ response = $ this -> sendRequest ( 'GET' , $ url ) ; $ status_code = $ response -> getStatusCode ( ) ; if ( $ status_code !== 200 ) { throw new FilestackException ( $ response -> getBody ( ) , $ status_code ) ; } $ json_response = json_decode ( $ response -> getBody ( ) , true ) ; return $ json_response ; }
Get the metadata of a remote file.  Will only retrieve specific fields
if optional fields are passed in

@param                   $url        url of file
@param                   $fields     optional, specific fields to retrieve.
values are: mimetype, filename, size,
width, height,location, path,
container, exif, uploaded (timestamp),
writable, cloud, source_url
@param FilestackSecurity $security   Filestack security object if
security settings is turned on

@throws FilestackException   if API call fails, e.g 400 bad request

@return array
Get the metadata of a remote file . Will only retrieve specific fields if optional fields are passed in