The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. February 09, 2012, 06:45:23 PM

Login with username, password and session length


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

Posts: 503


⎝⏠⏝⏠⎠


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

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 508


View Profile
« 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

"Everything that can be counted does not necessarily count; everything that counts cannot necessarily be counted." -- Albert Einstein
perkiset
Olde World Hacker
Administrator
Lifer
*****
Online Online

Posts: 9791



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 is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Phaėton
Lifer
*****
Offline Offline

Posts: 503


⎝⏠⏝⏠⎠


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

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
perkiset
Olde World Hacker
Administrator
Lifer
*****
Online Online

Posts: 9791



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 is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
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!