Thread: [PHP] Download client

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 [PHP] Download client 



    Join Date
    Dec 2010
    Posts
    833
    Thanks given
    261
    Thanks received
    121
    Rep Power
    204
    Reply With Quote  
     

  2. #2  
    puts "Hi "+name+
    Ruby's Avatar
    Join Date
    Apr 2012
    Age
    30
    Posts
    346
    Thanks given
    42
    Thanks received
    135
    Rep Power
    66
    Looks alright, isn't very efficient but it does the job
    Professional website developer
    Almost a decade experience
    Bespoke website templates
    CMS & forum themes
    Future proof & secure scripts
    We should chat...
    Reply With Quote  
     

  3. #3  



    Join Date
    Dec 2010
    Posts
    833
    Thanks given
    261
    Thanks received
    121
    Rep Power
    204
    Quote Originally Posted by ` Ruby View Post
    Looks alright, isn't very efficient but it does the job
    There's better/cleaner ways to do it, but like you said, it does the job.
    Reply With Quote  
     

  4. #4  
    Old Webdeveloper
    Dondxon's Avatar
    Join Date
    Aug 2011
    Posts
    1,144
    Thanks given
    209
    Thanks received
    108
    Rep Power
    65
    This could be fkn handy
    Those links huh, do i have to replace them with the DIRECT download link? or could i also use this php for using page's in webhost's?
    Do you need any PHP work done? Or are you looking for RSPS integrations? click herel.

    Vouches

    Reply With Quote  
     

  5. #5  



    Join Date
    Dec 2010
    Posts
    833
    Thanks given
    261
    Thanks received
    121
    Rep Power
    204
    Quote Originally Posted by Dondxon View Post
    This could be fkn handy
    Those links huh, do i have to replace them with the DIRECT download link? or could i also use this php for using page's in webhost's?
    Yes, those links need's to be direct. What do you mean with using page's in webhost? You mean redirecting to somewhere?

    If my 1. host was addddd.com, then it would be
    Code:
    $file = 'addddd.com/client.jar';
    If my 2. host was asdasd.com, then it would be
    Code:
    $file2 = 'asdasd.com/client.jar';
    Reply With Quote  
     

  6. #6  
    Renown Programmer

    Nikki's Avatar
    Join Date
    Aug 2008
    Posts
    3,992
    Thanks given
    553
    Thanks received
    1,078
    Rep Power
    5000
    This is HORRIBLE, EVERYTHING will go through your main server, no real distribution of the file load.

    It will have it's uses, but most people won't need it. I can only see this working ok for maybe a download that requires a login/whatever, but otherwise it'll use double the bandwidth and is limited by the speed of the transfer between hosts.

    Just use header('Location: ' . $file1); and die(), way simpler, splits it between hosts even more.

    And, use an array for files, instead of having 2 different variables simply loop through them until the file exists
    Please don't add/pm me asking for RSPS help!

    Links:
    - Pastebin
    - Sleeksnap

    Reply With Quote  
     

  7. Thankful user:


  8. #7  



    Join Date
    Dec 2010
    Posts
    833
    Thanks given
    261
    Thanks received
    121
    Rep Power
    204
    Quote Originally Posted by Nikki View Post
    This is HORRIBLE, EVERYTHING will go through your main server, no real distribution of the file load.

    It will have it's uses, but most people won't need it. I can only see this working ok for maybe a download that requires a login/whatever, but otherwise it'll use double the bandwidth and is limited by the speed of the transfer between hosts.

    Just use header('Location: ' . $file1); and die(), way simpler, splits it between hosts even more.

    And, use an array for files, instead of having 2 different variables simply loop through them until the file exists
    This is not splitting the downloads? huh.
    How does this double the bandwidth? And how is it limited?

    This just check's if host 1 is down and download's the file from host 2 if it is...

    Anyways your point is good on making it to use arrays, doing it now.
    Reply With Quote  
     

  9. #8  
    Renown Programmer

    Nikki's Avatar
    Join Date
    Aug 2008
    Posts
    3,992
    Thanks given
    553
    Thanks received
    1,078
    Rep Power
    5000
    Quote Originally Posted by Jagge View Post
    This is not splitting the downloads? huh.
    How does this double the bandwidth? And how is it limited?

    This just check's if host 1 is down and download's the file from host 2 if it is...

    Anyways your point is good on making it to use arrays, doing it now.
    The way readfile works is that it reads from the file then outputs over the original connection, since you are transferring it from one server to the main one before sending to the clients, you are doubling the bandwidth used server side.

    Oh, and this code is pretty much the first example of readfile with a couple lines added.
    Please don't add/pm me asking for RSPS help!

    Links:
    - Pastebin
    - Sleeksnap

    Reply With Quote  
     

  10. Thankful user:


  11. #9  



    Join Date
    Dec 2010
    Posts
    833
    Thanks given
    261
    Thanks received
    121
    Rep Power
    204
    Quote Originally Posted by Nikki View Post
    The way readfile works is that it reads from the file then outputs over the original connection, since you are transferring it from one server to the main one before sending to the clients, you are doubling the bandwidth used server side.

    Oh, and this code is pretty much the first example of readfile with a couple lines added.
    Didn't remember that readfile worked like that, tbh never really used it... will change it then.

    Thx.
    Reply With Quote  
     

  12. #10  
    Renown Programmer

    Nikki's Avatar
    Join Date
    Aug 2008
    Posts
    3,992
    Thanks given
    553
    Thanks received
    1,078
    Rep Power
    5000
    Quote Originally Posted by Jagge View Post
    Didn't remember that readfile worked like that, tbh never really used it... will change it then.

    Thx.
    Best way to do it is simply using the header function and redirecting to the file

    Edit: Foreach is an awesome tool.
    Code:
    <?php
    //links, change these.
    $arr = array('host1' => 'http://mydomain.com/client.jar', 'host2' => 'http://mydomain.net/client.jar');
    
    foreach($arr as $hostname => $file) {
    	if(file_exists($file)) {
    		header('Location: ' . $file);
    		die();
    	}
    }
    ?>
    Please don't add/pm me asking for RSPS help!

    Links:
    - Pastebin
    - Sleeksnap

    Reply With Quote  
     

  13. Thankful user:


Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Ares PHP chat client
    By Spooky in forum Website Development
    Replies: 1
    Last Post: 01-09-2010, 10:53 PM
  2. Replies: 32
    Last Post: 12-14-2007, 03:53 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •