Home › Forums › ACF PRO › Trying to get server path of a File › Reply To: Trying to get server path of a File
You will not be able to get the file path of a file field with a return format of URL.
You need to get or return the ID of the file to use the code that you referenced. You can either change the return format of the field to ID or you can get the ID by getting the unformatted value
// https://www.advancedcustomfields.com/resources/get_field/
$id = get_field('file_field_name', false, false);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.