Protecting PDF File Downloads
Last Post 11/17/2009 10:15 AM by Lee Sykes. 13 Replies.
Author Messages
Mark
Nuke Newbie
Nuke Newbie
Posts:9


--
10/13/2009 11:04 AM  
On one of our websites we have a TEXT/HTML module that lists links to several pdf files. How would we go about protecting some files for members only?

Some of the files in this list are available for everyone, others we want to require that people login before they can access the pdf file.

I read on another site that you can use the DNN LinkClick.aspx file processor to actually serve the file up when it is needed which makes it possible for you to set the file view permissions to restrict the viewing to just authenticated users or any other selected role.  How to you set that permission?
Joseph Craig
DNN MVP
Posts:11667


--
10/13/2009 11:14 AM  
First, create two directories using the File Manager. Set one of the directories to be visible to All Users. Set the other directory to be visible to Registered Users (or whichever security role you want to use). You set the permissions by selecting the directory using the File Manager and then, at the bottom of the page, checking the appropriate boxes. Upload files to the appropriate directories. In your Text/HTML module, create the links and specify the files that you want attached to them.

Joe Craig, Patapsco Research Group
Complete DNN Support
Mark
Nuke Newbie
Nuke Newbie
Posts:9


--
10/13/2009 11:36 AM  
That is what I was looking for, thanks for your help.
Mark
Nuke Newbie
Nuke Newbie
Posts:9


--
11/12/2009 9:20 AM  
Is there a trick to get this implementation to force the login screen for users that are not logged in? When someone is logged in the link works, but when they are not logged in we receive the following error.

The resource cannot be found.

Server Error in '/CIAB' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /CIAB/LinkClick.aspx

Joseph Craig
DNN MVP
Posts:11667


--
11/13/2009 8:14 AM  
Does this happen when you click a link?  Where does the link point?

Joe Craig, Patapsco Research Group
Complete DNN Support
Mark
Nuke Newbie
Nuke Newbie
Posts:9


--
11/13/2009 8:21 AM  
The link is on this page on our development site.

http://clientsites.euclidtechnology.com/ciab/ underneath the LinkedIn button.

The link points to the LinkClick.aspx file which points to a pdf file stored in a protected directory.

http://clientsites.euclidtechnology...d&tabid=39

The link works fine for users that are logged in, if you are not logged in you get the error shown above. What we need is for it to go to the login page and then download the pdf after a successful login.
Joseph Craig
DNN MVP
Posts:11667


--
11/13/2009 8:28 AM  
What you describe is the behavior that it should have.

Can you check the Event Log and post some details of any error that is posted there?

Joe Craig, Patapsco Research Group
Complete DNN Support
Mark
Nuke Newbie
Nuke Newbie
Posts:9


--
11/13/2009 8:32 AM  
The Event Log viewer is empty other than application start messages. We also get the same results (and no errors on other production website installations.)
Mark
Nuke Newbie
Nuke Newbie
Posts:9


--
11/16/2009 8:14 AM  
Posted By Joseph Craig on 13 Nov 2009 8:28 AM
What you describe is the behavior that it should have.



Can you clarify what you mean by what I describe is the behavior it should have. It should present a login box or it should show the error?
Joseph Craig
DNN MVP
Posts:11667


--
11/16/2009 4:16 PM  
If you have a file in a protected folder, users not logged in and not members of the security role should not be able to view or download the file.

Joe Craig, Patapsco Research Group
Complete DNN Support
Mark
Nuke Newbie
Nuke Newbie
Posts:9


--
11/17/2009 8:15 AM  
So is there a module or way in DNN to password protect pdf documents so that when a user clicks on the pdf link and they are not logged in, they are taken to a login page. After they have logged in, they are redirected to the pdf download?
Lee Sykes
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945


--
11/17/2009 8:29 AM  
Rather than show the link to logged out users, add a text module to the page with some content such as "you need to login to download the PDF" - you can set the permissions for the text HTML module to be only viewable by unauthenticated users, and you can set the permissions of the module that contains the download link to just be visible to logged in users.

You can use the same principle to display the login module, where it is only visible to unauthenticated users.

the permissions for the modules are accessed using modules menu / settings

In the next issue we cover some of the new features available in DNN 5 for permissions

Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile
Mark
Nuke Newbie
Nuke Newbie
Posts:9


--
11/17/2009 9:52 AM  
Showing or hiding the link based on logged in state will not work for our client. We are trying to mimic the features they had on their previous CMS and on a single page they would have links to about 20 pdf reference files. Some of them protected and others not.

Do you know of any modules that provide this type of functionality? Maybe a members only version of the LinkClick.aspx? link (i.e. MembersLinkClick.aspx) that prompts for username and password when the user is not logged in.
Lee Sykes
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945


--
11/17/2009 10:15 AM  
It could be worth having a look at a module such as document exchange

xepient also do a similar one

Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile


---