Jump to content

[SOLVED] Splitting a large file


Loldongs

Recommended Posts

Hey guys,

 

<?php
ini_set('memory_limit', '3000M');

$fp = fsockopen("127.0.0.1", 8001, $errno, $errstr, 30);

if (!$fp) { 
	die('Cannot connect'); 
}

$headers .= '***
icy-name:Dean PHP
icy-genre:Episodes
icy-metadata:1
icy-pub:0
icy-url: Google.com
icy-irc: irc.google.com
icy-icq: 123123
icy-aim: LOL
content-type:video/nsv
icy-br:128
icy-reset:1\n
';


    fwrite($fp, $headers);
    while (!feof($fp)) {
        echo fgets($fp, 128);
    }

$filename = "FILE.nsv";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);


fwrite($fp, $contents);
while (!feof($fp)) {
	echo fgets($fp, 128);
}

    fclose($fp);
?>

 

Basically above im sending a NSV file to a shoutcast stream but as you can see there is no limits on how fast it sends to the server.

 

Is there anyway i can split the file into parts and send them slowly or a way to set how many kb/s to send the file at

Link to comment
https://forums.phpfreaks.com/topic/105416-solved-splitting-a-large-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.