CodeIgniter Forums
Download large file - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Download large file (/showthread.php?tid=76198)



Download large file - omid_student - 04-21-2020

Hi
I cannot download large file in PHP
My code is :
PHP Code:
<?php
    
    $url 
base64_decode($_GET['url']);
    
    
set_time_limit(0);
    
    
$filename  pathinfo($urlPATHINFO_FILENAME).'.'.pathinfo($urlPATHINFO_EXTENSION);
    
    
file_put_contents("video/$filename",file_get_contents($url));
    
    exit(
'1');
    
?>
I set unlimit memory size and other


RE: Download large file - albertleao - 04-21-2020

Download to your server or send to your client?


RE: Download large file - omid_student - 04-21-2020

(04-21-2020, 06:49 AM)albertleao Wrote: Download to your server or send to your client?
Download from url and save to server
I found it
With copy function in PHP we can copy file from url to server with large size


RE: Download large file - John_Betong - 04-21-2020

@omid_student
> With copy function in PHP we can copy file from url to server with large size

Take a look at Rsync because not only is it able to download or transfer enormous files it selects only the part of a file that has been changed, zips and transfers.

I use Rsync most of the time and once setup it is far easier to use than FileZilla.

https://en.wikipedia.org/wiki/Rsync


RE: Download large file - omid_student - 04-24-2020

(04-21-2020, 08:41 AM)John_Betong Wrote: @omid_student
> With copy function in PHP we can copy file from url to server with large size

Take a look at Rsync because not only is it able to download or transfer enormous files it selects only the part of a file that has been changed, zips and transfers.

I use Rsync most of the time and once setup it is far easier to use than FileZilla.

https://en.wikipedia.org/wiki/Rsync
Thank you


RE: Download large file - InsiteFX - 04-24-2020

Download Large Files with PHP


RE: Download large file - John_Betong - 04-24-2020

@omid_student

Further to my previous post I think Rsync is installed by default on most Linux systems because it is used frequently to copy complete online domain contents across the web without having to download  a single file to the localhost.

Give this a whirl:

1.  creating a "RSYNC.php" in a new directory on your localhost computer 

2. modify the $src and $dst variables in the following file

3. run the script in the browser

4. copy and paste the output to a terminal window

5. if there are no errors then check to see if the file was uploaded to the online domain.

Here is a short script that copies all file from source to destination. The output needs to be copied and pasted into a command terminal:

File: RSYNC.php
Code:
<?php declare(strict_types=1);
  error_reporting(-1);            // should be set in php.ini
  ini_set('display_errors', '1'); // should be set in php.ini

  $src = '/var/www/supiet.tk';
  $dst = '[email protected]:/var/www/supiet.tk';

  echo "rsync -avz  {$src}/ -e ssh {$dst}/ ";

  // Check the manual for the -avz -e ssh parameters.
  // Please note and experiment with trailing slash usage