[Resolved] External File Link has extension removed

Home Forums Support External File Link has extension removed

  • This topic has 4 replies, 2 voices, and was last updated 1 year ago by Tim.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #1230605


    When using a “URL” type ACF field to point to an external .pdf file “Publication Link”, when clicking on the link the file extension is removed, landing on a parent page.

    <figure class="publication-header-media">
      $cover = get_field('cover');
      $size = 'full'; // (thumbnail, medium, large, full or custom size)
      $book_link = ( get_field('link') );
      if( $cover ) {
       echo '<a href="' . $book_link .'">' . wp_get_attachment_image( $cover, $size ) . '</a>';

    I suppose this is a server redirect.

    If I enter the URL directly into the browser address bar, the pdf loads in the pdf viewer.

    Is there a way I can force the file to download / load in the pdf viewer ?

    Customer Support

    Hi there,

    include target="_blank" attribute in your <a> – this will open a new tab which should open the PDF.



    target="_blank" is now in there, but no joy.

    Customer Support

    I think its a CORs issue:

    The browser is protecting the User by not allowing links from a different resource to be opened directly.


    I thought CORS was for inline/on_page content, not for opening an outbound address.

    As a test I uploaded one of the pdfs to a different domain I manage. The link to that file opened as expected. So I don’t think the browser is protecting the visitor for this scenario.

    I suppose the target problem server is employing a redirect against “link leaches” or something.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.