Allow download managers to download file through php script

Discussion in 'PHP' started by redlorry919, Dec 5, 2007.

  1. #1
    Hi all,

    I'm in development of a file download site script much like rapidshare. The one area I'm having problems with is permitting download managers to download files which can only be accessed through a user account.

    i.e. you currently log into the site and choose to download a file through your account. To hide the direct file url and log downloads, the download link is actually a php script which looks up the file and outputs it as a download. This however causes problems with download managers as since the DM does not know the user is logged in, the file download is blocked.

    Does anyone therefore know of a method to allow download managers to successfully download files via a user protected area?

    I'm aware there is a username/password option on DM however this doesn't seem to be passed to the script?

    Thanks in advance. :)
     
    redlorry919, Dec 5, 2007 IP
  2. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #2
    You can't.

    The only option is to generate a unique ID for each user and check that ID when downloading.

    Download managers don't hold sessions/cookies like browsers do.

    Peace,
     
    Barti1987, Dec 5, 2007 IP
  3. redlorry919

    redlorry919 Peon

    Messages:
    384
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the response.

    I had a feeling there wouldn't be a way with session/cookies. Saying that though if I choose to download something via a DM using rapidshare and dont tell the DM my rapidshare username/password it fails. As soon as I add my username/password it works fine so I would assume they get submitted to the download url somehow?
     
    redlorry919, Dec 5, 2007 IP
  4. szalinski

    szalinski Peon

    Messages:
    341
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i had exactly this problem, in that download managers dont use cookies. but with Rapidshare, they use authorisation with login and pass - although i don't know how!

    i tried passing the PHPSESSID in the url for a file download via PHP, e.g. http://mydomain.com/?PHPSESSID=0b4ec5e2s1c6592b10ea4s&file=myfile.rar and even though it works for me (resuming, etc.) some users reported not being able to resume or getting a 416 error. :confused:
     
    szalinski, Aug 10, 2008 IP