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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.