The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. July 29, 2010, 07:57:19 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Password only file availability  (Read 171 times)
Phaėton
Expert
****
Offline Offline

Posts: 322

⎝⏠⏝⏠⎠


View Profile
« on: February 02, 2010, 12:50:07 AM »

I want people to supply a password/be logged in before they get the
link to download the file.  Not a problem.  I just test for my condition,
if they meet my condition, (are logged in/supplied the password)
-- then they get the link.

Problem is, if they just know the link , they can get a file.

My first guess is to, generate a random file name,
making it good for an hour only by copying the real file
to that name , issue the temporary link and clean it up five minutes
later or once every few hours with a cron job that just deletes all
files named like that that are older than one hour...

I guess this would be a ghetto design to get the job done.. Any other suggestions
on how to think about overcoming this problem?

Logged

__̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡._
Bompa
Administrator
Expert
*****
Offline Offline

Posts: 383


View Profile WWW
« Reply #1 on: February 02, 2010, 04:28:44 AM »

I want people to supply a password/be logged in before they get the
link to download the file.  Not a problem.  I just test for my condition,
if they meet my condition, (are logged in/supplied the password)
-- then they get the link.

Problem is, if they just know the link , they can get a file.

They do not know the link until they qualify, so what's the problem?

They could pass the link around to others, but they could also just pass the file around to others.

They could also give the password to others.

Right?

I don't think there's a way to stop it.

Bompa
Logged

Do You Know?
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 8649



View Profile
« Reply #2 on: February 02, 2010, 03:04:17 PM »

Have the download be a PHP script. "echo" the contents of the file only if they are currently logged in.

Consider:
if ($_SESSION['isLoggedIn'])
	
echo 
file_get_contents('/www/sites/myRestrictedFile.bin');
else
	
echo 
'Ha ha. Too smart for you.';
Logged

It's the things you learn after you know it all that really count.
-John Wooden
Phaėton
Expert
****
Offline Offline

Posts: 322

⎝⏠⏝⏠⎠


View Profile
« Reply #3 on: February 23, 2010, 11:33:49 AM »

Okay ive considered this.

THis is interesting.. couldnt i just push a .avi out this way to stream it?

On another note, couldnt i use this as a redirect gateway so i can
bottleneck all traffic right where the fuel pump intersects with the
carb here..... all traffic through my php routine first for stats/mcp control, etc?

 Idea...
Logged

__̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡._
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 8649



View Profile
« Reply #4 on: February 25, 2010, 10:42:07 PM »

Totally. You can use this to absolutely control what/how is delivered, which you don't (easily) get with Apache.

Streaming is a bit of a different story, and no, I don't think it'd work that way. But pseudo-streaming, or start on incomplete like YouTube would probably work OK.
Logged

It's the things you learn after you know it all that really count.
-John Wooden
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!