i want to protect pdf files with Membership Media but

Hi
i want to protect pdf files with Membership Media but the file's name is set in a custom field and the protection is not working.
so is it possible to execute the protected function in php ?
like :
if is protected file
then replace initial folder 's text by mask folder 's text

if it is possible, can you tell me the name of the function to use ?

thanks