Page 1 of 1

[SOLVED] Upload problem

Posted: Thu Feb 03, 2005 8:32 pm
by sinewave
I am having trouble with uploading MP3 files using the following code....any smaller MP3 files seem to work, and it always makes the m3u for me, but for some reason on any bigger mp3 files 3meg+ it uploads for a while, creates the m3u but the mp3 does not show up. Is there some sort of time out limitation or does someone have a better way for me to do this? Any help would be greatly appreciated.

Code: Select all

$target = "../audio"; 

	if (is_dir($target) AND is_writable($target)) 
	{
		$oldName = $HTTP_POST_FILESї'mp3']ї'name'];
		$newName = str_replace(" ", "_", $oldName);
		
		$fExplode = explode(".",$newName);
		$m3u = addslashes($HTTP_GET_VARSї"ID"])."-".$fExplodeї0].".m3u";
		echo "m3u: ".$m3u;
  
		if (!$file_handle = fopen("../audio/".$m3u,"a")) 
		{
			echo "Cannot open file"; 
		}  
	
		if (!fwrite($file_handle, "http://www.example.com/audio/".$newName)) 
		{
			echo "Cannot write to file"; 
		}  
		echo "You have successfully written m3u file.";   
		fclose($file_handle); 
		copy($HTTP_POST_FILESї'mp3']ї'tmp_name'], "$target/$newName"); 
		echo $filename . " has been received.<br>";
	&#125;
	else
	&#123;
		echo $target. ': either invalid or write permission denied';
		exit();
	&#125;

Posted: Thu Feb 03, 2005 9:13 pm
by shiznatix
well there is the max_upload_size in your php.ini file and there is also somtin that is a auto time out setting so like after 4 minutes of continuous use it just stopps. check on both of those

Posted: Fri Feb 04, 2005 11:56 am
by sinewave
Thanks alot, that was the problem.