How to create PDF file upload field for post like meta box field admin side?

Follow below steps to create custom PDF upload field in custom post type:

  1. Install Advance Custom Field from wordpress.org
  2. Go to Custom Fields and click on Add New button.
  3. Follow instructions in below screenshot to add the custom field to upload PDF file.

enter image description here

  1. Use below code to display content on post type template.

    $pdf_file = get_field('pdf_upload');
    
    if( $file ) {
        echo '<a href="'.$pdf_file.'">Download File</a>';
    }
    

Reference Documentation: https://www.advancedcustomfields.com/resources/file/

Hope this helps..!!