• Resolved a00dev

    (@a00dev)


    Hello all,
    I am looking to use either a PDF or WORD DOC. as a file WITHOUT having a user DOWNLOAD it. Currently using Gutenberg and I know there is an option for “File” but it makes you have to download the document. I do NOT want that. I want a user to simply click on a file title and have the doc/PDF to open…? Is that possible and how? I keep seeing “WP-Content-upload” on sites I am using as research for but I do not have that option, as I did not download WP, do I need to for this type of situation? If so any helpful resources that walk you through actually using wp-content? I am fairly new to WP development so I think this is just a “lack of knowledge” situation, any help is appreciated.

    Version 5.5.1/ Woo commerce/ storefront theme/

    Below is an example site > if you click a “Lot number” for any product the document loads
    https://joyorganics.com/labs/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi, a00dev, I just wanted to know if the server that you are using is Apache, and if you have a .htaccess rule that is downloading PDFs because on a vanilla WordPress installation with Apache that I have, the PDF files are not automatically downloaded.

    You may have a rule that looks like this, which forces downloads of PDFs, in the .htaccess file:
    AddType application/octet-stream .pdf

    Thread Starter a00dev

    (@a00dev)

    Hi, Ian (@plantprogrammer)

    Sorry for the delay, I had to open a everything through filezilla which i was unfamiliar with. So the .htaccess file shows this:

    RewriteEngine On
    <Files *>
    Deny from all
    </Files>

    Are you saying in your response that i need to add “AddType application/octet-stream .pdf” to this instead of “deny from all” ..???

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using a document as a media file, how to?’ is closed to new replies.