Professional Web Applications Themes

Restricting access to a directory of pdf's - Macromedia ColdFusion

I want to restrict access to a directory that contains pdf's. So lets say i have /publicpdfs/ /memberpdfs/ public are free for all, members are available once you are logged in. I want to be able to link to the pdf's (preferably directly), but I need a way to make sure the user has logged in first. Since I am assuming application.cfm wont run when loading a pdf, how can I check to make sure the user is logged in? (besides password protecting the directrory in IIS)...

  1. #1

    Default Restricting access to a directory of pdf's

    I want to restrict access to a directory that contains pdf's.

    So lets say i have

    /publicpdfs/
    /memberpdfs/

    public are free for all, members are available once you are logged in. I want
    to be able to link to the pdf's (preferably directly), but I need a way to
    make sure the user has logged in first. Since I am assuming application.cfm
    wont run when loading a pdf, how can I check to make sure the user is logged in?

    (besides password protecting the directrory in IIS)

    jgladnick Guest

  2. #2

    Default Re: Restricting access to a directory of pdf's

    The best way, in my opinion, is to use cfcontent.

    It won't get you exactly what you want (when you say you'd prefer to link
    directly to the pdfs), but it will ensure that users are logged in first.

    Make a page, viewpdf.cfm, that you access as follows:
    [url]http://www.example.com/viewpdf.cfm?pdf=protectedpdf.pdf[/url]

    Then in viewpdf.cfm, you first ensure that they have rights to access the PDF
    file, then you do a cfcontent call that includes the
    /memberpdfs/protectedpdf.pdf file.

    Kronin555 Guest

  3. #3

    Default Re: Restricting access to a directory of pdf's

    That actually might work, thanks!
    jgladnick Guest

  4. #4

    Default Re: Restricting access to a directory of pdf's

    This is fine, but it will still not solve the problem of the viewer being able
    to steal the url of the pdf and distribute it, allowing for download without
    verifying logged in status?

    I have this same problem, I need to password protect a list of pdfs, sending
    them through the login system, even when they try to access the doent
    directly using: http://www.domain.com/secure/pdfname.pdf

    Any ideas how to do this?

    Thanks,
    Stephen
    Tallahassee, FL

    sbsmithfl Guest

  5. #5

    Default Re: Restricting access to a directory of pdf's

    If you are using cfcontent to display the pdf in the browser already you could
    just move the memberpdfs folder outside of the web root and change the path in
    your cfcontent tag. Cfcontent should still work and then there wouldn't be
    another url that would allow anyone to access these pdfs.

    Rouwd

    rouwd Guest

Similar Threads

  1. Restricting Access to CFX
    By Cory in forum Coldfusion Security
    Replies: 0
    Last Post: August 17th, 06:57 PM
  2. Restricting access
    By pastormco in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: September 14th, 10:25 PM
  3. restricting access to log-file
    By Nikolaj in forum ASP.NET Security
    Replies: 1
    Last Post: November 5th, 09:41 AM
  4. Restricting telnet access to user's home directory
    By robert@wolfmedia.homelinux.org in forum Linux Setup, Configuration & Administration
    Replies: 0
    Last Post: July 22nd, 02:13 AM
  5. Restricting user to a directory with vsftpd
    By Todd Cary in forum Linux Setup, Configuration & Administration
    Replies: 6
    Last Post: July 3rd, 10:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139