Zubrag.com
September 25, 2018, 11:18:06 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: Combining two scripts to password_protect files  (Read 71149 times)
alfalambda
Newbie
*
Posts: 1


« Reply #14 on: March 28, 2011, 12:26:56 PM »

I'm definitely a newcomer; so, sorry for my naiveness.
Yes, with http://whatever.whatever.xxx/download.php?f=filename.pdf I'm asked for usn/pwd
But, with http://whatever.whatever.xxx/filename.pdf  I plainly get the filename.pdf

How to avoid this?

Thanks

alfalambda

Logged
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #15 on: March 29, 2011, 12:28:32 AM »

The idea is your direct (plain) file path should be unknown and you shouldn't expose it to the world. You only expose your "Yes" link.

If you'd like to avoid direct file access, you'll have to use url rewriting (if your server has mod_rewrite module loaded). Either add url rewrite rule for all your files , or place them in one folder and add one rule for all. I'm not good at rewriting rules, but rule will have to map urls of this structure http://example.com/some/folder/filename.ext to http://example.com/path/to/download.php?f=filename.ext
Logged
zubragbillone
Newbie
*
Posts: 9


« Reply #16 on: March 27, 2012, 04:46:30 AM »

I'm definitely a newcomer; so, sorry for my naiveness.
Yes, with http://whatever.whatever.xxx/download.php?f=filename.pdf I'm asked for usn/pwd
But, with http://whatever.whatever.xxx/filename.pdf  I plainly get the filename.pdf

How to avoid this?

Thanks

alfalambda

Well,  I don't - if I do not log in to the site,  I get "404 Error File Not Found"
Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC