Get local file path
-
Hi,
I’m trying to get the path to the file when I have the ID. This is what I’m doing:
$rev_id = Document_Revisions::$instance->get_latest_revision($id); $rev_post = get_post($rev_id); $revision = get_post($rev_post->post_content); $filepath = get_attached_file($revision->ID);$filepath is then something like this (and the file does not exist):
/var/vhosts/wordpress/wp-content/uploads/sites/2/2014/03/d41d8cd98f00b204e9800998ecf8427e.pdf
While the actual file is at:
/var/vhosts/wordpress/wp-content/uploads/sites/2/2014/03/test-file.pdf
Can you help?
Thanks,
Tom Adams
dxw
The topic ‘Get local file path’ is closed to new replies.