how this can be implemented using php???
Posted: Tue Sep 04, 2007 3:13 am
hi.. everyone..
what i want to do is I want to give users a download link only if he is logged in.
I mean to say. say..
if the link is http://somedomailn.net/samplevideo.avi
then if once the user logged and gets the link.
he can pass it to any of his friend who is not registered member of my site(not even related to my site) then that friend can download the video.
I have 2 ways in my mind.
1. the file name should be variable( this is a bad. and stupid method)
2. instead of giving the user download link. I will give him link to a php script which will interface between user and file. I mean that script will act like a proxy for the file. and checks if the session variables(for login) are set. and if set then streams the file(which is some where on server) other wise says that you are not logged in.
advantages: problem is solved. and download accelerators cannot be used.(since its my script which is splitting the file into chunks and sending. so speed is controlled by me. am i right???)
disadvantages: inceasing load on my server. my server's cpu has to do a lot of work
no my questions are..
1. How to implement my second idea using php. any tutorial?? or links?? pls..
2. Are there any other methods?? through which this can be done.
3. How does the rapidshare/gmail work?? (because problem is same..)
4. In my 2nd method does really download accelerators are disabled???
what i want to do is I want to give users a download link only if he is logged in.
I mean to say. say..
if the link is http://somedomailn.net/samplevideo.avi
then if once the user logged and gets the link.
he can pass it to any of his friend who is not registered member of my site(not even related to my site) then that friend can download the video.
I have 2 ways in my mind.
1. the file name should be variable( this is a bad. and stupid method)
2. instead of giving the user download link. I will give him link to a php script which will interface between user and file. I mean that script will act like a proxy for the file. and checks if the session variables(for login) are set. and if set then streams the file(which is some where on server) other wise says that you are not logged in.
advantages: problem is solved. and download accelerators cannot be used.(since its my script which is splitting the file into chunks and sending. so speed is controlled by me. am i right???)
disadvantages: inceasing load on my server. my server's cpu has to do a lot of work
no my questions are..
1. How to implement my second idea using php. any tutorial?? or links?? pls..
2. Are there any other methods?? through which this can be done.
3. How does the rapidshare/gmail work?? (because problem is same..)
4. In my 2nd method does really download accelerators are disabled???