PHP midgard_blob method remove_file
Remove file associated with attachment.
bool remove_file(void);
midgard_blob method remove_file takes no parameters.
Removes file associated with midgard_attachment. Returns TRUE if file has been sucsessfuly removed, FALSE otherwise.
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())
$removed = $blob->remove_file();
if($removed)
echo "File removed";
?>
More details about fails can be found in [midgard-core docs][0].
