shopp_verify_stored_file

called via AJAX to verify a file existing in a storage engine.

add_filter( 'shopp_verify_stored_file', [callback] )

@param string $filename the filename for the to verify exists.

Description

called via AJAX to verify a file existing in a storage engine.

A filter implemented for shopp_verify_stored_file does not return. It should die with “OK” if the file is verified.

Example

// register filter callback
add_filter('shopp_verify_stored_file', 'shopp_verify_stored_file_filter');

// create filter function
function shopp_verify_stored_file_filter( $filename ) {
    // if the file is supposed to exist on the filesystem
    $filename = sanitize_path(realpath($filename));

    if (!file_exists($filename)) die('NULL');
    if (is_dir($filename)) die('ISDIR');
    if (!is_readable($filename)) die('READ');   
}

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar