Loldongs Posted May 13, 2008 Share Posted May 13, 2008 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 More sharing options...
mraiur Posted May 13, 2008 Share Posted May 13, 2008 hmmm why dont you just set max_execution_time ? And left it no mather how long it takes to upload ... Link to comment https://forums.phpfreaks.com/topic/105416-solved-splitting-a-large-file/#findComment-539884 Share on other sites More sharing options...
Loldongs Posted May 13, 2008 Author Share Posted May 13, 2008 The problem is i want it to take time to upload it needs to upload about 1 megabyte a minuite to keep the stream in sync Link to comment https://forums.phpfreaks.com/topic/105416-solved-splitting-a-large-file/#findComment-540396 Share on other sites More sharing options...
Fadion Posted May 13, 2008 Share Posted May 13, 2008 Take a look at this tutorial, maybe it helps. Link to comment https://forums.phpfreaks.com/topic/105416-solved-splitting-a-large-file/#findComment-540455 Share on other sites More sharing options...
Loldongs Posted May 14, 2008 Author Share Posted May 14, 2008 Thanks thats exactly what i was after Link to comment https://forums.phpfreaks.com/topic/105416-solved-splitting-a-large-file/#findComment-540487 Share on other sites More sharing options...
severndigital Posted May 14, 2008 Share Posted May 14, 2008 please mark topics solved if you've completed. Link to comment https://forums.phpfreaks.com/topic/105416-solved-splitting-a-large-file/#findComment-540532 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.