views:

45

answers:

1

been trying to upload music onto a server for my website, to no avail, but strangely enough the script works fine when uploading pictures.

  if(copy($_FILES['musicFile1']['tmp_name'],"uploads/".$_SESSION['username']."/item".$s_id."/".$filename1.""))
   {
   if(chmod("uploads/".$_SESSION['username']."/item".$s_id."/".$filename1."", 0664))
   {
   $msg.= "<p>File successfully copied/p>\n";
   }
   else 
   {
   $msg.= "<p>Error: failed to chmod file</p>";
   }
   } 
   else 
  {
   $msg.= "<p>Error: failed to copy file</p>";
  }
+7  A: 

You will likely need to check your upload_max_filesize value in your ini file. It may be too low to allow music (which is generally a few mb's), but large enough to allow photos (which is generally only a few hundred k). Additionally, max_execution_time may need to be re-worked as well to allow for longer script-execution times.

http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize

See also "Common Pitfalls" when uploading files.

Jonathan Sampson
+1 The default is something like 2 MB.
Peter D
well that is an epic fail since am uploading the files to a school server and the specs say my needs to be able to upload music :/
death the kid
You can drop in your own php.ini file into your folder and there is chance it should override the lower settings for stuff like that.
IPX Ares