Title: Executable .pdf File
Last modified: March 27, 2021

---

# Executable .pdf File

 *  Resolved [ikatsanis](https://wordpress.org/support/users/ikatsanis/)
 * (@ikatsanis)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/executable-pdf-file/)
 * Hello,
    I have tested that a file restrction work fine with logged users. But
   when user write the path to browser, then display without deny any file in the
   library folder ( Tested in private Mode ) Shortcode `[library-viewer have_file_access
   ="logged_in"]`
 * Here the .htaccess code
 *     ```
       Order Allow,Deny
       Allow from all
       <Files ~ "\.(gif|jpg|png|pdf|doc|excel)$">
       Deny from all
       </Files>
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fexecutable-pdf-file%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Pexle Chris](https://wordpress.org/support/users/pexlechris/)
 * (@pexlechris)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/executable-pdf-file/#post-14242839)
 * The code snippet, it is right I think as I can see here [https://stackoverflow.com/questions/13396033/blocking-pdf-files-from-direct-access-using-htaccess](https://stackoverflow.com/questions/13396033/blocking-pdf-files-from-direct-access-using-htaccess)
 * Maybe there is a setting in the Apache server that doesn’t allow restricting 
   access to PDFs with this code…
 * But as you can see, this snippet works fine for php files.
 * THE ONLY THINK THAT I CAN CONSIDER NOW IS TO
    1) buy Library Viewer Pro: [https://www.pexlechris.dev/library-viewer/pro/](https://www.pexlechris.dev/library-viewer/pro/)
   2) create a folder with random name here and in it to place the “library” folder
   [https://mblcosmetics.gr/randomname/library/](https://mblcosmetics.gr/randomname/library/)
   3) use the shortcode [library-viewer path=”randomname/library” have_file_access
   =”logged_in”] 4) and place the file in “library” folder here: [https://mblcosmetics.gr/randomname/library/tests.pdf](https://mblcosmetics.gr/randomname/library/tests.pdf)
 * This that user will see in the frontend will be same as this that see now, but
   he/she will not know the real path of the file…
 *  Thread Starter [ikatsanis](https://wordpress.org/support/users/ikatsanis/)
 * (@ikatsanis)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/executable-pdf-file/#post-14243220)
 * Thank you. I have purchased the pro version and all its fine!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Executable .pdf File’ is closed to new replies.

 * ![](https://ps.w.org/library-viewer/assets/icon-256x256.png?rev=2120573)
 * [Library Viewer](https://wordpress.org/plugins/library-viewer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/library-viewer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/library-viewer/)
 * [Active Topics](https://wordpress.org/support/plugin/library-viewer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/library-viewer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/library-viewer/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [ikatsanis](https://wordpress.org/support/users/ikatsanis/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/executable-pdf-file/#post-14243220)
 * Status: resolved