Open Source Content Management System

PHP midgard_blob method get_path

  1. Example

GEt absolute path to a file associated with attachment.

string get_path(void);

midgard_blob method get_path takes no parameters.

Returns absolute path of a file, or NULL on failure.

Example

<?php

try {
    $attachment = new midgard_attachment($guid);
} catch (midgard_error_exception $e) {
    echo $e->getMessage();
}

try {
    $blob = new midgard_blob($attachment);
} catch (midgard_error_exception $e) {
    echo $e->getMessage();
}

if($blob->exists())
    echo "File exists:".$blob->get_path(); 

?>

More details about fails can be found in [midgard-core docs][0].

Designed by Nemein, hosted by Anykey