public function delete()
    {
        if (!$this->url)
        {
            throw new AVException("Cannot delete file that has not been saved.");
        }

        $headers = AVClient::_getRequestHeaders(null, true);
        $url = AVClient::HOST_NAME . '/files/' . $this->getName();
        $rest = curl_init();
        curl_setopt($rest, CURLOPT_URL, $url);
        curl_setopt($rest, CURLOPT_CUSTOMREQUEST, "DELETE");
        curl_setopt($rest, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($rest, CURLOPT_HTTPHEADER, $headers);
        $response = curl_exec($rest);
        $contentType = curl_getinfo($rest, CURLINFO_CONTENT_TYPE);
        if (curl_errno($rest))
        {
            throw new AVException(curl_error($rest), curl_errno($rest));
        }
        curl_close($rest);
    }
public function delete()
    {
        if (!$this->url)
        {
            throw new AVException("Cannot delete file that has not been saved.");
        }

        $headers = AVClient::_getRequestHeaders(null, true);
        $url = AVClient::HOST_NAME . '/files/' . $this->getName();
        $rest = curl_init();
        curl_setopt($rest, CURLOPT_URL, $url);
        curl_setopt($rest, CURLOPT_CUSTOMREQUEST, "DELETE");
        curl_setopt($rest, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($rest, CURLOPT_HTTPHEADER, $headers);
        $response = curl_exec($rest);
        $contentType = curl_getinfo($rest, CURLINFO_CONTENT_TYPE);
        if (curl_errno($rest))
        {
            throw new AVException(curl_error($rest), curl_errno($rest));
        }
        curl_close($rest);
    }
public function delete ( ) { if ( ! $ this -> url ) { throw new AVException ( "Cannot delete file that has not been saved." ) ; } $ headers = AVClient :: _getRequestHeaders ( null , true ) ; $ url = AVClient :: HOST_NAME . '/files/' . $ this -> getName ( ) ; $ rest = curl_init ( ) ; curl_setopt ( $ rest , CURLOPT_URL , $ url ) ; curl_setopt ( $ rest , CURLOPT_CUSTOMREQUEST , "DELETE" ) ; curl_setopt ( $ rest , CURLOPT_RETURNTRANSFER , 1 ) ; curl_setopt ( $ rest , CURLOPT_HTTPHEADER , $ headers ) ; $ response = curl_exec ( $ rest ) ; $ contentType = curl_getinfo ( $ rest , CURLINFO_CONTENT_TYPE ) ; if ( curl_errno ( $ rest ) ) { throw new AVException ( curl_error ( $ rest ) , curl_errno ( $ rest ) ) ; } curl_close ( $ rest ) ; }
Send a REST request to delete the AVFile

@throws AVException
Send a REST request to delete the AVFile