Welcome Guest, Not a member yet? Register   Sign In
Download large file
#1

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
Reply
#2

Download to your server or send to your client?
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply
#3

(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
Reply
#4

@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
Reply
#5

(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
Reply
#6

Download Large Files with PHP
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#7

(This post was last modified: 04-24-2020, 09:20 PM by John_Betong.)

@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
Reply




Theme © iAndrew 2016 - Forum software by © MyBB